chrispolo / Keypoints-of-humanpose-with-Mask-R-CNN

Use the Mask RCNN for the human pose estimation
266 stars 90 forks source link

shape error #2

Open kei-bility opened 6 years ago

kei-bility commented 6 years ago

Hi, this is a great work. I saw this error running on inferece_humanpose.ipynb How can I fix it?

---------------------------------------------------------------------------
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).
chrispolo commented 6 years ago

@kei-bility Sorry for answering lately,have you solved this problem? Load the correct pre_trained_weight path,I think it was ok.

kurzacz commented 5 years ago

@kei-bility Solution from this issue helped me: https://github.com/chrispolo/Keypoints-of-humanpose-with-Mask-R-CNN/issues/3