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

ValueError: Layer #314 (named "time_distributed_2"), weight <tf.Variable 'time_distributed_2/kernel:0' shape=(2048, 4096) dtype=float32_ref> has shape (2048, 4096), but the saved weight has shape (4096, 4096). #79

Open
Qcatbot opened this issue May 10, 2020 · 2 comments

Comments

@Qcatbot
Copy link

Qcatbot commented May 10, 2020

I trained using densenet121_weights_tf_dim_ordering_tf_kernels_notop.h5. But when I test, I get the following error. Any suggestions?

WARNING:tensorflow:From /usr/local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:3445: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.
Instructions for updating:
Please use rate instead of keep_prob. Rate should be set to rate = 1 - keep_prob.
Loading weights from models/densenet/voc.hdf5
Traceback (most recent call last):
File "test_frcnn.py", line 185, in
model_classifier.load_weights(C.model_path, by_name=True)
File "/usr/local/lib/python3.6/site-packages/keras/engine/network.py", line 1163, in load_weights
reshape=reshape)
File "/usr/local/lib/python3.6/site-packages/keras/engine/saving.py", line 1149, in load_weights_from_hdf5_group_by_name
str(weight_values[i].shape) + '.')
ValueError: Layer #314 (named "time_distributed_2"), weight <tf.Variable 'time_distributed_2/kernel:0' shape=(2048, 4096) dtype=float32_ref> has shape (2048, 4096), but the saved weight has shape (4096, 4096).

@Qcatbot Qcatbot changed the title Loading weights from models/densenet/voc.hdf5 Traceback (most recent call last): File "test_frcnn.py", line 185, in <module> model_classifier.load_weights(C.model_path, by_name=True) File "/usr/local/lib/python3.6/site-packages/keras/engine/network.py", line 1163, in load_weights reshape=reshape) File "/usr/local/lib/python3.6/site-packages/keras/engine/saving.py", line 1149, in load_weights_from_hdf5_group_by_name str(weight_values[i].shape) + '.') ValueError: Layer #314 (named "time_distributed_2"), weight <tf.Variable 'time_distributed_2/kernel:0' shape=(2048, 4096) dtype=float32_ref> has shape (2048, 4096), but the saved weight has shape (4096, 4096). ValueError: Layer #314 (named "time_distributed_2"), weight <tf.Variable 'time_distributed_2/kernel:0' shape=(2048, 4096) dtype=float32_ref> has shape (2048, 4096), but the saved weight has shape (4096, 4096). May 10, 2020
@kentaroy47
Copy link
Owner

Sorry I haven't tried out densenet for this repo.
Resnets should work fine and achieve similar accuracy.

@ravi-lourem
Copy link

@kentaroy47 Hi..Need for help
all_imgs[filename]['width'] = cols
NameError: name 'cols' is not defined ..

this happen simple parser... class mapping check but can solve..

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