Darkflow: ValueError: cannot convert float NaN to integer

Created on 24 Sep 2016  ·  22Comments  ·  Source: thtrieu/darkflow

Dear
Thank you very much for posting Yolo in tensorflow.
I try the demo and get the following error. Could you please have a look?
First, I download the yolotiny.weights from Yolo website.

Then,

python clean.py /home/karl/Documents/VOCdevkit/VOC2012/Annotations
[===================>]100%
Statistics:
pottedplant: 13442
person: 17401
tvmonitor: 15512
Dataset size: 26089

At last, I run the test code:

python tensor.py --test data --model tiny
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcurand.so locally
parsing yolo-tiny.cfg
Traceback (most recent call last):
  File "tensor.py", line 37, in <module>
    yoloNet = YOLO(FLAGS.model + int(step > 0) * '-{}'.format(step))
  File "/home/karl/Documents/online_code/yolotf/Yolo.py", line 57, in __init__
    self.build(model)
  File "/home/karl/Documents/online_code/yolotf/Yolo.py", line 71, in build
    for i, info in enumerate(layers):
  File "/home/karl/Documents/online_code/yolotf/configs/process.py", line 60, in cfg_yielder
    size = int(size)
ValueError: cannot convert float NaN to integer

How to fix that?
Thank you very much.

Most helpful comment

@karlTUM @kivijoshi here is the old weight file https://drive.google.com/open?id=0B1tW_VtY7onibmdQWE1zVERxcjQ

All 22 comments

The size of yolotiny.weights is 103.4Mb and I think the error comes out of this. But I do not know how to fix that.

Hi @karlTUM, according to the available configs/yolo-tiny.cfg, the size of yolo-tiny.weights MUST be 180MB (4 bytes for each parameter - you can check it yourself). So the problem is either you downloaded the wrong weight file, or the YOLO authors released a new config with size 103MB. In the latter situation, you must replace this new config into ./configs before running the demo.

Good luck!

I've looked at the YOLO webpage. They indeed released a new config compare to when I develop this repo. So you must use the old weight file (180MB) for the demo to be successful.

Thank you. I will download an old version

where can I download old weight file?

@kivijoshi I'll try to upload it.

thanks :)

I also tried swapping cfg file with new one from darknet repo. but it does not work
I get this msg..
expect 870256 bytes, found 108399816

new config file consists of batch-normalization layers. This is new compare to the old configs and my code currently cannot work with these.

@karlTUM @kivijoshi here is the old weight file https://drive.google.com/open?id=0B1tW_VtY7onibmdQWE1zVERxcjQ

Thanks a lot for the thread. I'm wondering whether anyone has the old yolo-full weight file?

The old tiny weight file works perfectly fine.

@jwnsu I have that one too, please wait until I uploaded it.

@thtrieu I'm wondering whether you find time to upload the old full yolo weight files. From the testing, it seems full model outperforms small and tiny quite a bit in a few test models.

When I create new model (e.g. 3c), tried to copy extraction.conv.weights as yolo-full.weights, but it seems genw.py does not take partial weight as darknet does.

Thanks again. Appreciate the project and efforts.

@thtrieu I'd like also to ask about the old yolo-coco.weights file since the current one online has been replaced with batch-normalization conv layers too. This will complete the configuration set for this fine project. Thanks in advance.

@jwnsu @Mu7ammad
The full weight file is here: https://drive.google.com/open?id=0B1tW_VtY7onicFlqclhnRGlodGM

I believe I will finish building the batch-normalization layer as well as allowing to import partial network within this week. Thanks for pointing out the need.

P/S: the old COCO model is one that I did not have access to unfortunately :(

Thanks a lot, Trieu. One question for you: do you have plan to refresh
yolotf to pick up recent changes in yolo, e.g. the batch_normalize feature.

Best,
Dennis

On Mon, Nov 7, 2016 at 9:10 AM, Trieu [email protected] wrote:

@jwnsu https://github.com/jwnsu @Mu7ammad https://github.com/Mu7ammad
The full weight file is here: https://drive.google.com/open?id=0B1tW_
VtY7onicFlqclhnRGlodGM

I believe I will finish building the batch-normalization layer as well as
allowing to import partial network within this week. Thanks for pointing
out the need.

P/S: the old COCO model is one that I did not have access to unfortunately
:(


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/thtrieu/yolotf/issues/1#issuecomment-258897563, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAM4Ky1cHvisw2gd9Uc3AHIULuLleQruks5q71uSgaJpZM4KFoaR
.

@jwnsu I do, the plan is to support partial weight file as well as adding batch_norm layer within this week, as stated in the previous post

Great! Will watch your checkin, I'm happy to test and report result to you.

Dennis

On Mon, Nov 7, 2016 at 9:48 AM, Trieu [email protected] wrote:

@jwnsu https://github.com/jwnsu I do, the plan is to support partial
weight file as well as adding batch_norm layer within this week, as stated
in the previous post


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/thtrieu/yolotf/issues/1#issuecomment-258908020, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAM4K9Dpgw87zobCGHgl1434v6TvCevjks5q72RlgaJpZM4KFoaR
.

@thtrieu That would be great, looking forward to these updates, 頑張って!

@jwnsu @Mu7ammad
Sorry that I missed my deadline, but I finish it just few minutes ago and want to give you guys a friendly ping. Now everything is fine with the new tiny-yolo (108MB) and yolo (789 MB). The old configs are still working fine (yolo-full 1GB, yolo-small 376MB and yolo-tiny 180MB). A lot of code is refactored and so does the syntax. So have a quick look at README to be updated.

The next goal is to work on yolov2, or essentially work on route, reorg and region layers.

Cheers.

@thtrieu great news it now supports the latest models, thanks for the good effort. I'm then interested to try out tiny-coco next since it's close to tiny-yolo, will explore the code and syntax.

@Mu7ammad The dynamics are already there. The only thing you need to do is to add coco label list, which I've already done in a new commit.

Now you can run coco (tiny-coco and yolo-coco) just fine. (tell me if there's any problem)

Was this page helpful?
0 / 5 - 0 ratings