question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi , while training the model for a custom dataset I am facing the follow error :

File "/home/adithya/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 2620, in load_weights
    load_weights_from_hdf5_group_by_name(f, self.layers)
  File "/home/adithya/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 3206, in load_weights_from_hdf5_group_by_name
    K.batch_set_value(weight_value_tuples)
  File "/home/adithya/anaconda3/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2247, in batch_set_value
    assign_op = x.assign(assign_placeholder)
  File "/home/adithya/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/variables.py", line 573, in assign
    return state_ops.assign(self._variable, value, use_locking=use_locking)
  File "/home/adithya/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/state_ops.py", line 276, in assign
    validate_shape=validate_shape)
  File "/home/adithya/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/gen_state_ops.py", line 57, in assign
    use_locking=use_locking, name=name)
  File "/home/adithya/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
    op_def=op_def)
  File "/home/adithya/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2958, in create_op
    set_shapes_for_outputs(ret)
  File "/home/adithya/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2209, in set_shapes_for_outputs
    shapes = shape_func(op)
  File "/home/adithya/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2159, in call_with_requiring
    return call_cpp_shape_fn(op, require_shape_fn=True)
  File "/home/adithya/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/common_shapes.py", line 627, in call_cpp_shape_fn
    require_shape_fn)
  File "/home/adithya/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/common_shapes.py", line 691, in _call_cpp_shape_fn_impl
    raise ValueError(err.message)
ValueError: Dimension 3 in both shapes must be equal, but are 9 and 720 for 'Assign_297' (op: 'Assign') with input shapes: [3,3,256,9], [3,3,256,720].

So , do I need to reshape the images ? Please can someone help me out with this issue. Thank you

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
luislofer89commented, Feb 8, 2018

Trying to hel other people with this issue, I get this error when I tried to train a model loading pretrained weights with different number of clases in the output layer by error.

0reactions
adithya-subramaniancommented, Jan 6, 2019

Hi, I got this problem because I loaded weights which had different final layer size (number of classes) than that of the pre-trained weights. I hope that helps

Read more comments on GitHub >

github_iconTop Results From Across the Web

What should I do if my scientific calculator is showing ... - Quora
If your matrices don't have compatible dimensions, you will get this error. When multiplying matrices, the inner values much match.
Read more >
Error Messages
Your calculator displays the ERR:DIMENSION MISMATCH error if you are trying to perform an operation that references one or more lists or matrices...
Read more >
Why is there a dimension error? : r/nspire - Reddit
I don't know what you're trying to do but it looks like you're trying to find the value of x for 2x=3x^2. As...
Read more >
Questions & Answers for: casio dimension error - Fixya
...dimension error' comes up! It is most likely that the lists you are using as input data are of unequal lengths: One has...
Read more >
TI-89 Error Codes: Argument, Dimension, Memory & More
TI-89 Error Codes: Contents. Address Error; Argument Error; Dimension Error; Domain Error; Error Memory; Syntax Error; Undefined Variable ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found