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

retrain_yolo image size/shape (416,416 vs 416,416,3) #175

Open
goodwillyoga opened this issue Dec 16, 2019 · 0 comments
Open

retrain_yolo image size/shape (416,416 vs 416,416,3) #175

goodwillyoga opened this issue Dec 16, 2019 · 0 comments

Comments

@goodwillyoga
Copy link

goodwillyoga commented Dec 16, 2019

I'm getting the error when using the combination of package_dataset.py https://github.com/alecGraves/DATA/blob/master/package_dataset.py by alec to create npz file for images and bounding boxes and running retrain_yolo.py

The error is happening with retrain_yolo.py:
File "retrain_yolo.py", line 157, in process_data
return np.array(processed_images), np.array(boxes)
ValueError: could not broadcast input array from shape (416,416,3) into shape (416,416)

But it could be the way npz file is being created. What I am failing to understand is how training images which are of shape like
(750, 1000, 3), (1080, 1920, 3), (320, 480, 3) etc...can be resized by retrain_yolo.py...

images = [PIL.Image.fromarray(i) for i in images]
processed_images = [i.resize((416, 416), PIL.Image.BICUBIC) for i in images]

Of course, here is when I'm getting the error:
ValueError: could not broadcast input array from shape (416,416,3) into shape (416,416)

The original images have a shape of three. Can someone please help understand what's happening here. Thanks

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

1 participant