Closed liershui closed 6 years ago
Hi! I am getting the same issue in demo_human_pose.ipynb, seems like a mismatch between the input tensors. I am also looking for the solution. Can anyone please help?
ValueError: Dimension 1 in both shapes must be equal, but are 8 and 324. Shapes are [1024,8] and [1024,324]. for 'Assign_1365' (op: 'Assign') with input shapes: [1024,8], [1024,324].
@liershui @Ahmer-444 Can you give detailed information about this error? I can run this demo correctly.
@liershui @Ahmer-444 Please Tell me the following information.
here is what i did, sorry for my annoying expression. i ran demo_human_pose.ipynb with jupyter, python3.5.2, keras2.1.5, tensorflow1.3.0, i have run Mask_RCNN (https://github.com/matterport/Mask_RCNN) in my environment so i think my environment is ok.
when i ran the 2nd cell in demo_human_pose.ipynb, i got this error:
InvalidArgumentError Traceback (most recent call last) /usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/common_shapes.py in _call_cpp_shape_fn_impl(op, input_tensors_needed, input_tensors_as_shapes_needed, require_shape_fn) 653 graph_def_version, node_def_str, input_shapes, input_tensors, --> 654 input_tensors_as_shapes, status) 655 except errors.InvalidArgumentError as err:
/usr/lib/python3.5/contextlib.py in exit(self, type, value, traceback) 65 try: ---> 66 next(self.gen) 67 except StopIteration:
/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/errors_impl.py in raise_exception_on_not_ok_status() 465 compat.as_text(pywrap_tensorflow.TF_Message(status)), --> 466 pywrap_tensorflow.TF_GetCode(status)) 467 finally:
InvalidArgumentError: Dimension 1 in both shapes must be equal, but are 8 and 324 for 'Assign_682' (op: 'Assign') with input shapes: [1024,8], [1024,324].
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
also when i was trying to continue my training with an h5 file in /mylogs, i got the same error.
I also got error below. How can I fix it?
Loading weights from /notebooks/Mask_RCNN_Humanpose/mask_rcnn_coco_humanpose.h5
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-23-38cd5c09f443> in <module>()
11 assert model_path != "", "Provide path to trained weights"
12 print("Loading weights from ", model_path)
---> 13 model.load_weights(model_path, by_name=True)
14 #model.load_weights(model_path, by_name=True,exclude=["mrcnn_bbox_fc"])
15 #model.load_weights(model_path, by_name=True,exclude=["mrcnn_class_logits", "mrcnn_bbox_fc", "mrcnn_bbox", "mrcnn_mask"])
/notebooks/Mask_RCNN_Humanpose/model.py in load_weights(self, filepath, by_name, exclude)
2850
2851 if by_name:
-> 2852 saving.load_weights_from_hdf5_group_by_name(f, layers)
2853 else:
2854 saving.load_weights_from_hdf5_group(f, layers)
/usr/local/lib/python3.5/dist-packages/keras/engine/saving.py in load_weights_from_hdf5_group_by_name(f, layers, skip_mismatch, reshape)
1016 ' has shape {}'.format(K.int_shape(symbolic_weights[i])) +
1017 ', but the saved weight has shape ' +
-> 1018 str(weight_values[i].shape) + '.')
1019 else:
1020 weight_value_tuples.append((symbolic_weights[i],
ValueError: Layer #389 (named "mrcnn_bbox_fc"), weight <tf.Variable 'mrcnn_bbox_fc_6/kernel:0' shape=(1024, 8) dtype=float32_ref> has shape (1024, 8), but the saved weight has shape (1024, 324).
Hello, I have this question, so can you tell me how do you deal with this problem? Thank you. ValueError Traceback (most recent call last)
You need to download the pre-trained weights from this repository: https://github.com/Superlee506/Mask_RCNN_Humanpose/releases/download/v0.9-alpha/mask_rcnn_coco_humanpose.h5
within the demo_human_pose.ipynb you reference to mask_rcnn_coco_humanpose.h5
file but actually then downloading matterports pre-trained weights via utils.download_trained_weights()
function!
-- ValueError: Layer matterport#389 (named "mrcnn_bbox_fc"), weight <tf.Variable 'mrcnn_bbox_fc_6/kernel:0' shape=(1024, 16) dtype=float32_ref> has shape (1024, 16), but the saved weight has shape (1024, 324). which means your number of classes are making (1+3) x 4 = 16 vectors at top, but probably your are calling coco model weights which has a shape of (1+80) x 4 = 324 vector in size and you are getting this error. Please be sure whether your script is calling coco model weights or your own trained model weigths.
Hi
Thanks for your effort,
I tested demo_human_pose.ipynb with your mask_rcnn_coco_humanpose.h5 file, it gives me the following error.
ValueError: Dimension 1 in both shapes must be equal, but are 324 and 8. Shapes are [1024,324] and [1024,8]. for 'Assign_682' (op: 'Assign') with input shapes: [1024,324], [1024,8].
i tried to add exclude=["mrcnn_class_logits", "mrcnn_bbox_fc", "mrcnn_bbox", "mrcnn_mask"], it gives meaningless results. any solutions please?