SteganalysisCNN icon indicating copy to clipboard operation
SteganalysisCNN copied to clipboard

ValueError: Shapes are incompatible

Open silent-code opened this issue 4 years ago • 1 comments

Hi, I've preprocessed my data set according to preprocess_dataset.py and then I run train.py and get the following error

Traceback (most recent call last): File "train.py", line 210, in main() File "train.py", line 171, in main model.set_weights([preprocess_weights]) File "/Users/tz/.virtualenvs/dl4cv/lib/python3.7/site-packages/keras/engine/network.py", line 527, in set_weights K.batch_set_value(tuples) File "/Users/tz/.virtualenvs/dl4cv/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py", line 2960, in batch_set_value tf_keras_backend.batch_set_value(tuples) File "/Users/tz/.virtualenvs/dl4cv/lib/python3.7/site-packages/tensorflow_core/python/keras/backend.py", line 3343, in batch_set_value x.assign(np.asarray(value, dtype=dtype(x))) File "/Users/tz/.virtualenvs/dl4cv/lib/python3.7/site-packages/tensorflow_core/python/ops/resource_variable_ops.py", line 814, in assign self._shape.assert_is_compatible_with(value_tensor.shape) File "/Users/tz/.virtualenvs/dl4cv/lib/python3.7/site-packages/tensorflow_core/python/framework/tensor_shape.py", line 1115, in assert_is_compatible_with raise ValueError("Shapes %s and %s are incompatible" % (self, other)) ValueError: Shapes (5, 5, 128, 4) and (5, 5, 1, 4) are incompatible

I presume my data are (1, 128, 128) at the input. Any thoughts on the incompatibility error?

Thanks in advance, Tim

silent-code avatar Jan 24 '20 22:01 silent-code