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

Unable to convert weights file into tf #7

Open
cat768 opened this issue May 12, 2020 · 7 comments
Open

Unable to convert weights file into tf #7

cat768 opened this issue May 12, 2020 · 7 comments

Comments

@cat768
Copy link

cat768 commented May 12, 2020

my custom weights file is junglecamp0.6.weights, based on yolov3 (not yolov3-tiny)
31 classes

When I run the command " python load_weights.py --weights ./weights/junglecamp0.6.weights --output ./weights/junglecamp0.6.tf " it gives me the following error message:

ValueError: cannot reshape array of size 76070 into shape (256,128,3,3)

@cat768
Copy link
Author

cat768 commented May 12, 2020

image

@cat768
Copy link
Author

cat768 commented May 12, 2020

Here is my cfg file:

junglecamp0.5.txt

(saved it to a txt file instead of cfg because github won't allow me to upload cfg)

@safayildirim
Copy link

You should provide number of custom classes you have as parameters.

@cat768
Copy link
Author

cat768 commented May 21, 2020

You should provide number of custom classes you have as parameters.

How do I do that? (I have 31 classes)

@ejri
Copy link

ejri commented Jun 22, 2020

Screen Shot 2020-06-22 at 1 59 21 AM

in the load_weights.py file, change the number of classes from 80 to 31 in your case.

Also make sure to make the changes in app.py and detect.py

Screen Shot 2020-06-22 at 2 19 29 AM

Screen Shot 2020-06-22 at 2 19 14 AM

@Shreyas0812
Copy link

I did this, but got the same error...

Object-Detection-API/yolov3_tf2/utils.py", line 68, in load_darknet_weights
conv_shape).transpose([2, 3, 1, 0])
ValueError: cannot reshape array of size 209204 into shape (512,256,3,3)

@Zwj321123
Copy link

Screen Shot 2020-06-22 at 1 59 21 AM

in the load_weights.py file, change the number of classes from 80 to 31 in your case.

Also make sure to make the changes in app.py and detect.py

Screen Shot 2020-06-22 at 2 19 29 AM Screen Shot 2020-06-22 at 2 19 14 AM

This works for me! Thank you!

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