noobCubed / Real-Time-Facial-Expression-Recognition

Real Time Facial Expression Recognition from Webcam using Convolutional Neural Networks and OpenCV
0 stars 2 forks source link

Dimension 1 in both shapes must be equal, but are 512 and 128. #2

Open CryptoExchangeFR opened 6 years ago

CryptoExchangeFR commented 6 years ago

python3 webcam.py Using TensorFlow backend. Created model successfully Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1567, in _create_c_op c_op = c_api.TF_FinishOperation(op_desc) tensorflow.python.framework.errors_impl.InvalidArgumentError: Dimension 1 in both shapes must be equal, but are 512 and 128. Shapes are [57600,512] and [57600,128]. for 'Assign_4' (op: 'Assign') with input shapes: [57600,512], [57600,128].

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "webcam.py", line 31, in model = cnn.load_model("cnn_128x128_2convmax_2fc_64f_32bs_100e.h5") File "/Users/pierrelavarague/Developpement/Real-Time-Facial-Expression-Recognition/cnn1.py", line 50, in load_model classifier.load_weights(weights_path) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/keras/engine/network.py", line 1180, in load_weights f, self.layers, reshape=reshape) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/keras/engine/saving.py", line 929, in load_weights_from_hdf5_group K.batch_set_value(weight_value_tuples) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2430, in batch_set_value assign_op = x.assign(assign_placeholder) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/ops/variables.py", line 615, in assign return state_ops.assign(self._variable, value, use_locking=use_locking) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/ops/state_ops.py", line 283, in assign validate_shape=validate_shape) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/ops/gen_state_ops.py", line 60, in assign use_locking=use_locking, name=name) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3392, in create_op op_def=op_def) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1734, in init control_input_ops) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1570, in _create_c_op raise ValueError(str(e)) ValueError: Dimension 1 in both shapes must be equal, but are 512 and 128. Shapes are [57600,512] and [57600,128]. for 'Assign_4' (op: 'Assign') with input shapes: [57600,512], [57600,128].

Hi !

I got this error when I run the main script. Do you know how to solve it ?

Thanks :)

Thilanka97 commented 6 years ago

I got the same error! did you find a solution for this ?

marcel303 commented 4 years ago

(Same issue. Using Tensorflow 1.14.0.)