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

Model Error #11

Open
Eliie58 opened this issue May 28, 2018 · 6 comments
Open

Model Error #11

Eliie58 opened this issue May 28, 2018 · 6 comments

Comments

@Eliie58
Copy link

Eliie58 commented May 28, 2018

I downloaded the checkpoint from the mentioned link: https://drive.google.com/open?id=0B1l5JSkBbENBdk95ZW1DOUhqQUE

When i run the command: python cam.py --model_path cam_checkpoint.hdf5 --image_path=image.jpg

I get the following error: File "/home/user/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1570, in _create_c_op
raise ValueError(str(e))
ValueError: Dimension 0 in both shapes must be equal, but are 3 and 64. Shapes are [3,3,5,64] and [64,3,3,3]. for 'Assign' (op: 'Assign') with input shapes: [3,3,5,64], [64,3,3,3].

The full Error is:
Traceback (most recent call last):
File "cam.py", line 61, in
visualize_class_activation_map(args.model_path, args.image_path, args.output_path)
File "cam.py", line 18, in visualize_class_activation_map
model = load_model(model_path)
File "/usr/local/lib/python2.7/dist-packages/keras/models.py", line 246, in load_model
topology.load_weights_from_hdf5_group(f['model_weights'], model.layers)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 3189, in load_weights_from_hdf5_group
K.batch_set_value(weight_value_tuples)
File "/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py", line 2365, in batch_set_value
assign_op = x.assign(assign_placeholder)
File "/home/user/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/variables.py", line 615, in assign
return state_ops.assign(self._variable, value, use_locking=use_locking)
File "/home/user/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/state_ops.py", line 283, in assign
validate_shape=validate_shape)
File "/home/user/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/gen_state_ops.py", line 60, in assign
use_locking=use_locking, name=name)
File "/home/user/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/home/user/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 3392, in create_op
op_def=op_def)
File "/home/user/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1734, in init
control_input_ops)
File "/home/user/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1570, in _create_c_op
raise ValueError(str(e))
ValueError: Dimension 0 in both shapes must be equal, but are 3 and 64. Shapes are [3,3,5,64] and [64,3,3,3]. for 'Assign' (op: 'Assign') with input shapes: [3,3,5,64], [64,3,3,3].

Any idea why is this happening?

@95xueqian
Copy link

i hava the same problem whith you, did you solve it?

@Jeralyn123
Copy link

i aslo hava the same problem whith you, did you solve it?

@farm365
Copy link

farm365 commented Jan 2, 2019

god,i have the same error,anybody got the answer?

@meghana30
Copy link

You need to run the command like below:
python cam.py --model_path=cam_checkpoint.hdf5 --image_path=<Enter_the_imagePath_you_want_to_test_on> --output_path=test.jpg

@jspir1t
Copy link

jspir1t commented Apr 2, 2019

I run the command like you said, problems still occur

@matak07
Copy link

matak07 commented Jan 6, 2020

@meghana30 I tried the command your way but still getting the same error. Did anyone get any solution?

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

7 participants