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

Error in colab notebook, cannot reshape array of size 687 into shape (32,3,3,3) #56

Closed
robmarkcole opened this issue Jun 8, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@robmarkcole
Copy link

In colab notebook YoloV4_Dectection_Example.ipynb, at the cell:

!convert-darknet-weights yolov4.weights -o yolov4.h5
!ls -la ./yolov4.h5

I hit error:

Traceback (most recent call last):
  File "/usr/local/bin/convert-darknet-weights", line 8, in <module>
    sys.exit(convert_darknet_weights())
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/tf2_yolov4/tools/convert_darknet_weights.py", line 103, in convert_darknet_weights
    .reshape((filters, input_filters, kernel_size[0], kernel_size[1]))
ValueError: cannot reshape array of size 687 into shape (32,3,3,3)

ls: cannot access './yolov4.h5': No such file or directory

I confirmed yolov4.weights was downloaded successfully. Clearly 'reshape array of size 687 into shape (32,3,3,3)' is not going to succeed

@RaphaelMeudec RaphaelMeudec added the bug Something isn't working label Jun 10, 2020
@AntoineToubhans
Copy link
Collaborator

Hi @robmarkcole, thanks for opening this issue.
I was not able to reproduce the error, the colab works perfectly fine with me.

Are you sure the yolov4.weights file was downloaded entirely? Its size should be 257717640:

Screenshot 2020-06-13 at 09 42 27

If yes, could you give me more detail so that I can reproduce the bug?

@robmarkcole
Copy link
Author

Hi @AntoineToubhans
reran the notebook just now and completed fine this time. I guess it was a corrupted download.
Thanks and keep up the great work.
Cheers

@ZumelzuR
Copy link

Hello, the problem is with the wget command, I download it always incomplete (just 3 KB) so maybe better to download it directly from google or with
wget -P --no-check-certificate --no-proxy <url>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants