Open Shamoonmohd opened 4 years ago
Can you please format the coed with a code snippet. And also what tensorflow and keras version you're using in which OS?
You probably use tensorflow 2 and mask rcnn uses tensorflow>=1.3.0
as you can see from the requirements.
Could someone give me a hint about some way to fix this error below @innat @mobiuscreek @Shamoonmohd ? Current version used:
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
WARNING:tensorflow:From /content/gdrive/My Drive/Fish-characteristic-measurement/Complete_code/mrcnn/model.py:775: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast instead.
---------------------------------------------------------------------------
InvalidArgumentError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py in _create_c_op(graph, node_def, inputs, control_inputs)
1658 try:
-> 1659 c_op = c_api.TF_FinishOperation(op_desc)
1660 except errors.InvalidArgumentError as e:
InvalidArgumentError: Dimension 1 in both shapes must be equal, but are 8 and 324. Shapes are [1024,8] and [1024,324]. for 'Assign_682' (op: 'Assign') with input shapes: [1024,8], [1024,324].
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
11 frames
<ipython-input-6-466612329d97> in <module>()
95
96 # Load weights trained on MS-COCO
---> 97 model.load_weights(COCO_MODEL_PATH, by_name=True)
98
99 # COCO Class names
/content/gdrive/My Drive/Fish-characteristic-measurement/Complete_code/mrcnn/model.py in load_weights(self, filepath, by_name, exclude)
2117
2118 if by_name:
-> 2119 topology.load_weights_from_hdf5_group_by_name(f, layers)
2120 else:
2121 topology.load_weights_from_hdf5_group(f, layers)
/usr/local/lib/python3.6/dist-packages/keras/engine/topology.py in load_weights_from_hdf5_group_by_name(f, layers, skip_mismatch, reshape)
3477 weight_values[i]))
3478
-> 3479 K.batch_set_value(weight_value_tuples)
/usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py in batch_set_value(tuples)
2370 assign_placeholder = tf.placeholder(tf_dtype,
2371 shape=value.shape)
-> 2372 assign_op = x.assign(assign_placeholder)
2373 x._assign_placeholder = assign_placeholder
2374 x._assign_op = assign_op
/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/variables.py in assign(self, value, use_locking, name, read_value)
1760 """
1761 assign = state_ops.assign(self._variable, value, use_locking=use_locking,
-> 1762 name=name)
1763 if read_value:
1764 return assign
/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/state_ops.py in assign(ref, value, validate_shape, use_locking, name)
221 return gen_state_ops.assign(
222 ref, value, use_locking=use_locking, name=name,
--> 223 validate_shape=validate_shape)
224 return ref.assign(value, name=name)
225
/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/gen_state_ops.py in assign(ref, value, validate_shape, use_locking, name)
62 _, _, _op = _op_def_lib._apply_op_helper(
63 "Assign", ref=ref, value=value, validate_shape=validate_shape,
---> 64 use_locking=use_locking, name=name)
65 _result = _op.outputs[:]
66 _inputs_flat = _op.inputs
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/op_def_library.py in _apply_op_helper(self, op_type_name, name, **keywords)
786 op = g.create_op(op_type_name, inputs, output_types, name=scope,
787 input_types=input_types, attrs=attr_protos,
--> 788 op_def=op_def)
789 return output_structure, op_def.is_stateful, op
790
/usr/local/lib/python3.6/dist-packages/tensorflow/python/util/deprecation.py in new_func(*args, **kwargs)
505 'in a future version' if date is None else ('after %s' % date),
506 instructions)
--> 507 return func(*args, **kwargs)
508
509 doc = _add_deprecated_arg_notice_to_docstring(
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py in create_op(***failed resolving arguments***)
3298 input_types=input_types,
3299 original_op=self._default_original_op,
-> 3300 op_def=op_def)
3301 self._create_op_helper(ret, compute_device=compute_device)
3302 return ret
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py in __init__(self, node_def, g, inputs, output_types, control_inputs, input_types, original_op, op_def)
1821 op_def, inputs, node_def.attr)
1822 self._c_op = _create_c_op(self._graph, node_def, grouped_inputs,
-> 1823 control_input_ops)
1824
1825 # Initialize self._outputs.
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py in _create_c_op(graph, node_def, inputs, control_inputs)
1660 except errors.InvalidArgumentError as e:
1661 # Convert to ValueError for backwards compatibility.
-> 1662 raise ValueError(str(e))
1663
1664 return c_op
ValueError: Dimension 1 in both shapes must be equal, but are 8 and 324. Shapes are [1024,8] and [1024,324]. for 'Assign_682' (op: 'Assign') with input shapes: [1024,8], [1024,324].
in line 72 I got error of attribute AttributeError Traceback (most recent call last)