Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: cannot convert float NaN to integer #1

Closed
jiankang1991 opened this issue Sep 24, 2016 · 22 comments
Closed

ValueError: cannot convert float NaN to integer #1

jiankang1991 opened this issue Sep 24, 2016 · 22 comments

Comments

@jiankang1991
Copy link

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.

@jiankang1991
Copy link
Author

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.

@thtrieu
Copy link
Owner

thtrieu commented Sep 24, 2016

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!

@thtrieu
Copy link
Owner

thtrieu commented Sep 24, 2016

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.

@jiankang1991
Copy link
Author

Thank you. I will download an old version

@kivijoshi
Copy link

where can I download old weight file?

@thtrieu
Copy link
Owner

thtrieu commented Oct 2, 2016

@kivijoshi I'll try to upload it.

@kivijoshi
Copy link

thanks :)

@kivijoshi
Copy link

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

@thtrieu
Copy link
Owner

thtrieu commented Oct 2, 2016

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

@thtrieu
Copy link
Owner

thtrieu commented Oct 7, 2016

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

@jwnsu
Copy link

jwnsu commented Oct 18, 2016

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.

@thtrieu
Copy link
Owner

thtrieu commented Oct 18, 2016

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

@jwnsu
Copy link

jwnsu commented Nov 6, 2016

@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.

@Mu7ammad
Copy link

Mu7ammad commented Nov 6, 2016

@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.

@thtrieu
Copy link
Owner

thtrieu commented Nov 7, 2016

@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 :(

@jwnsu
Copy link

jwnsu commented Nov 7, 2016

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 notifications@github.com 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
#1 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAM4Ky1cHvisw2gd9Uc3AHIULuLleQruks5q71uSgaJpZM4KFoaR
.

@thtrieu
Copy link
Owner

thtrieu commented Nov 7, 2016

@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

@jwnsu
Copy link

jwnsu commented Nov 7, 2016

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 notifications@github.com 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
#1 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAM4K9Dpgw87zobCGHgl1434v6TvCevjks5q72RlgaJpZM4KFoaR
.

@thtrieu thtrieu closed this as completed Nov 7, 2016
@Mu7ammad
Copy link

Mu7ammad commented Nov 7, 2016

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

@thtrieu
Copy link
Owner

thtrieu commented Nov 30, 2016

@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.

@Mu7ammad
Copy link

@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.

@thtrieu
Copy link
Owner

thtrieu commented Dec 1, 2016

@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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants