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

Invalid Argument Error "Input to reshape is a tensor with 76 values, but the requested shape requires a multiple of 6" #4

Open
igorlacroix opened this issue Mar 27, 2023 · 4 comments

Comments

@igorlacroix
Copy link

Dear Prabhakar,

Thank you for your "Custom Keypoint Detection" tutorial, it's very helpful!

I could follow most of the steps from the annotation process until the generation of TFrecord, but when I ran the training step I couldn't go further.
The script presented the following error:
tensorflow.python.framework.errors_impl.InvalidArgumentError: {{function_node _wrapped__IteratorGetNext_output_types_19_device/job:localhost/replica:0/task:0/device:GPU:0}} Input to reshape is a tensor with 76 values, but the requested shape requires a multiple of 6
[[{{node Reshape_8}}]]
[[MultiDeviceIteratorGetNextFromShard]]
[[RemoteCall]] [Op:IteratorGetNext]

I annotated 60 512x512 floor plan images with 3 categories, wall corner, door and window, each category with only one keypoint. There's an average of 50 annotations per image.
I'm using Colab with standard GPU for CenterNet HourGlass 104 512x512. I couldn't work with the splitting script for the JSON annotations, so I splitted them manually for training and validation.
When I generated the TFrecord, the generate_tfrecord_from_coco.py script created the train.record and val.record files, but it presented the following error:
File "/content/gdrive/MyDrive/projects/custom_keypoint_detection/dataset/generate_tfrecord_from_coco.py", line 242, in create_tf_example
keypoints = keypoint_annotations['keypoints']
KeyError: 'keypoints'

I've checked many Stack Overflow and Github questions about the issue from the subject, but none of them present specific solutions.

I keep myself available.

Best regards,
Igor

@benasmi
Copy link

benasmi commented Mar 28, 2023

I'm having the same issue when training model on multiple classes and keypoints.

ensorflow.python.framework.errors_impl.InvalidArgumentError: {{function_node _wrapped__IteratorGetNext_output_types_19_device/job:localhost/replica:0/task:0/device:GPU:0}} Input to reshape is a tensor with 56 values, but the requested shape requires a multiple of 26
[[{{node Reshape_8}}]]
[[MultiDeviceIteratorGetNextFromShard]]
[[RemoteCall]] [Op:IteratorGetNext]

@igorlacroix
Copy link
Author

Dear @pijoneris,
Have you tried to train a model with a single class and keypoints? Did it work?
Best,
Igor

@kangombec
Copy link

I'm having the same issue when training model on multiple classes and keypoints.

ensorflow.python.framework.errors_impl.InvalidArgumentError: {{function_node _wrapped__IteratorGetNext_output_types_19_device/job:localhost/replica:0/task:0/device:GPU:0}} Input to reshape is a tensor with 56 values, but the requested shape requires a multiple of 26 [[{{node Reshape_8}}]] [[MultiDeviceIteratorGetNextFromShard]] [[RemoteCall]] [Op:IteratorGetNext]

Hi @benasmi did you manage to train on multiple class?

@kangombec
Copy link

I'm having the same issue when training model on multiple classes and keypoints.
ensorflow.python.framework.errors_impl.InvalidArgumentError: {{function_node _wrapped__IteratorGetNext_output_types_19_device/job:localhost/replica:0/task:0/device:GPU:0}} Input to reshape is a tensor with 56 values, but the requested shape requires a multiple of 26 [[{{node Reshape_8}}]] [[MultiDeviceIteratorGetNextFromShard]] [[RemoteCall]] [Op:IteratorGetNext]

Hi @benasmi did you manage to train on multiple class?

If so how did you finally get to to train. I'am having the same issue as 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

3 participants