You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run the resnet module, I meet a problem with the shape of layer.Here is the output:
Traceback (most recent call last):
File "PredictFromCamera.py", line 89, in
video_capture(_args)
File "PredictFromCamera.py", line 26, in video_capture
model, labels_map, int_to_labels_map = load_model(args.data_root, args.model, args.snapshot)
File "/media/bongos/Seagate1/tensorflow/lego_detector/Predict.py", line 252, in load_model
model.load_weights(os.path.join(snapshot_path, snapshot), by_name=True)
File "/home/bongos/venv/lib/python3.5/site-packages/keras/engine/network.py", line 1163, in load_weights
reshape=reshape)
File "/home/bongos/venv/lib/python3.5/site-packages/keras/engine/saving.py", line 1149, in load_weights_from_hdf5_group_by_name
str(weight_values[i].shape) + '.')
ValueError: Layer #176 (named "dense_1"), weight <tf.Variable 'dense_1/kernel:0' shape=(100352, 38) dtype=float32_ref> has shape (100352, 38), but the saved weight has shape (2048, 38).
My environment is tensorflow-gpu 1.12.0, Keras 2.2.4, Keras-Applications 1.0.7, Keras-Preprocessing 1.0.9
Can you help me with the problem?
The text was updated successfully, but these errors were encountered:
Hi Lucci,
Thank you for reporting. The issue has something to do with global average pooling, which appears to be absent from the model. I will take a look.
When I run the resnet module, I meet a problem with the shape of layer.Here is the output:
Traceback (most recent call last):
File "PredictFromCamera.py", line 89, in
video_capture(_args)
File "PredictFromCamera.py", line 26, in video_capture
model, labels_map, int_to_labels_map = load_model(args.data_root, args.model, args.snapshot)
File "/media/bongos/Seagate1/tensorflow/lego_detector/Predict.py", line 252, in load_model
model.load_weights(os.path.join(snapshot_path, snapshot), by_name=True)
File "/home/bongos/venv/lib/python3.5/site-packages/keras/engine/network.py", line 1163, in load_weights
reshape=reshape)
File "/home/bongos/venv/lib/python3.5/site-packages/keras/engine/saving.py", line 1149, in load_weights_from_hdf5_group_by_name
str(weight_values[i].shape) + '.')
ValueError: Layer #176 (named "dense_1"), weight <tf.Variable 'dense_1/kernel:0' shape=(100352, 38) dtype=float32_ref> has shape (100352, 38), but the saved weight has shape (2048, 38).
My environment is tensorflow-gpu 1.12.0, Keras 2.2.4, Keras-Applications 1.0.7, Keras-Preprocessing 1.0.9
Can you help me with the problem?
The text was updated successfully, but these errors were encountered: