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 about fasterRcnn #53

Open
ainilian opened this issue Apr 16, 2020 · 0 comments
Open

error about fasterRcnn #53

ainilian opened this issue Apr 16, 2020 · 0 comments

Comments

@ainilian
Copy link

ValueError Traceback (most recent call last)
in ()
5 plt.savefig('image_demo_random.png')
6
----> 7 model.load_weights('weights/faster_rcnn.h5', by_name=True)

~/software/anaconda3/envs/tf2/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training.py in load_weights(self, filepath, by_name, skip_mismatch)
232 raise ValueError('Load weights is not yet supported with TPUStrategy '
233 'with steps_per_run greater than 1.')
--> 234 return super(Model, self).load_weights(filepath, by_name, skip_mismatch)
235
236 @trackable.no_automatic_dependency_tracking

~/software/anaconda3/envs/tf2/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/network.py in load_weights(self, filepath, by_name, skip_mismatch)
1218 if by_name:
1219 hdf5_format.load_weights_from_hdf5_group_by_name(
-> 1220 f, self.layers, skip_mismatch=skip_mismatch)
1221 else:
1222 hdf5_format.load_weights_from_hdf5_group(f, self.layers)

~/software/anaconda3/envs/tf2/lib/python3.6/site-packages/tensorflow_core/python/keras/saving/hdf5_format.py in load_weights_from_hdf5_group_by_name(f, layers, skip_mismatch)
775 symbolic_weights[i])) +
776 ', but the saved weight has shape ' +
--> 777 str(weight_values[i].shape) + '.')
778
779 else:

ValueError: Layer #4 (named "b_box_head"), weight <tf.Variable 'faster_rcnn_1/b_box_head/rcnn_class_logits/kernel:0' shape=(1024, 21) dtype=float32, numpy=
array([[ 0.04120427, -0.04799104, -0.04488889, ..., -0.05834993,
0.02002645, -0.02086098],
[ 0.0270995 , 0.04724167, 0.072772 , ..., 0.02565087,
0.0062356 , 0.01444595],
[ 0.06293212, 0.07488425, 0.00248578, ..., 0.03330924,
-0.01808247, -0.00931749],
...,
[ 0.02366448, 0.05037834, 0.0206476 , ..., -0.07045348,
0.03336326, -0.01885421],
[ 0.0645275 , 0.02696343, -0.05525204, ..., 0.05430315,
0.02212766, -0.04695521],
[ 0.01637869, -0.00132833, 0.03295995, ..., -0.0239434 ,
0.01851077, 0.04825734]], dtype=float32)> has shape (1024, 21), but the saved weight has shape (1024, 81).

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