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

Cannot convert custom darknet .weights to .h5, AssertionError #72

Open
NazillyMada opened this issue May 12, 2021 · 1 comment · May be fixed by #74
Open

Cannot convert custom darknet .weights to .h5, AssertionError #72

NazillyMada opened this issue May 12, 2021 · 1 comment · May be fixed by #74

Comments

@NazillyMada
Copy link

I try to convert my custom darknet .weights to .h5 but i got error 'AssertionError'

this is my command :

!convert-darknet-weights ./yolov4-digits-digital_best.weights -o yolov4-digits_digital_best.h5 -n 11

and this is the error :

image

@DaemonOnCode DaemonOnCode linked a pull request Aug 24, 2021 that will close this issue
12 tasks
@tylertroy
Copy link

Hopefully the PR above is merged but in the mean time I found that the AssertionError is caused by the --n_classes (-n) arg being used in two places. The first to convert the original yolov4.weights to .h5 which requires -n=80 and the second for the custom model which will be -n=N_CUSTOM_CLASSES By the running the program twice, once for each N, you can get generate the required weights. Just note that when you run with n=80 the first time you raise a ValueError of ValueError: cannot reshape array of size 4559937 into shape (1024,512,3,3) Just ignore this and run again with the correct -n for your custom weights.

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

Successfully merging a pull request may close this issue.

2 participants