AliaksandrSiarohin / pose-gan

381 stars 78 forks source link

ValueError: Dimension 0 in both shapes must be equal, but are 3 and 64. Shapes are [3,3,18,64] and [64,21,3,3]. for 'Assign_2' (op: 'Assign') with input shapes: [3,3,18,64], [64,21,3,3]. #41

Open TwistSun opened 4 years ago

TwistSun commented 4 years ago

Hi, when i use your checkpoint file "generator-warp-mask-nn3-cl12.h5" for market test, I get this error: Using TensorFlow backend. 2019-10-20 16:21:09.954087: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA Generate images... Number of images: 32668 Number of pairs train: 263632 Number of pairs test: 12000 WARNING:tensorflow:From /data00/home/menyifang/anaconda3/envs/tfold/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py:1290: calling reduce_mean (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead Traceback (most recent call last): File "/data00/home/menyifang/code/comparison/pose-gan-fix/pose-gan/test.py", line 152, in test() File "/data00/home/menyifang/code/comparison/pose-gan-fix/pose-gan/test.py", line 118, in test generator.load_weights(args.generator_checkpoint) File "/data00/home/menyifang/anaconda3/envs/tfold/lib/python2.7/site-packages/keras/engine/topology.py", line 2619, in load_weights load_weights_from_hdf5_group(f, self.layers) File "/data00/home/menyifang/anaconda3/envs/tfold/lib/python2.7/site-packages/keras/engine/topology.py", line 3095, in load_weights_from_hdf5_group K.batch_set_value(weight_value_tuples) File "/data00/home/menyifang/anaconda3/envs/tfold/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 2188, in batch_set_value assign_op = x.assign(assign_placeholder) File "/data00/home/menyifang/anaconda3/envs/tfold/lib/python2.7/site-packages/tensorflow/python/ops/variables.py", line 594, in assign return state_ops.assign(self._variable, value, use_locking=use_locking) File "/data00/home/menyifang/anaconda3/envs/tfold/lib/python2.7/site-packages/tensorflow/python/ops/state_ops.py", line 276, in assign validate_shape=validate_shape) File "/data00/home/menyifang/anaconda3/envs/tfold/lib/python2.7/site-packages/tensorflow/python/ops/gen_state_ops.py", line 59, in assign use_locking=use_locking, name=name) File "/data00/home/menyifang/anaconda3/envs/tfold/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "/data00/home/menyifang/anaconda3/envs/tfold/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 3162, in create_op compute_device=compute_device) File "/data00/home/menyifang/anaconda3/envs/tfold/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 3208, in _create_op_helper set_shapes_for_outputs(op) File "/data00/home/menyifang/anaconda3/envs/tfold/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2427, in set_shapes_for_outputs return _set_shapes_for_outputs(op) File "/data00/home/menyifang/anaconda3/envs/tfold/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2400, in _set_shapes_for_outputs shapes = shape_func(op) File "/data00/home/menyifang/anaconda3/envs/tfold/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2330, in call_with_requiring return call_cpp_shape_fn(op, require_shape_fn=True) File "/data00/home/menyifang/anaconda3/envs/tfold/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 627, in call_cpp_shape_fn require_shape_fn) File "/data00/home/menyifang/anaconda3/envs/tfold/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 691, in _call_cpp_shape_fn_impl raise ValueError(err.message) ValueError: Dimension 0 in both shapes must be equal, but are 3 and 64. Shapes are [3,3,18,64] and [64,21,3,3]. for 'Assign_2' (op: 'Assign') with input shapes: [3,3,18,64], [64,21,3,3].

Do you have any idea to solve? (environment is as same as yours and it works well for fashion dataset) Thanks!

AliaksandrSiarohin commented 4 years ago

What is you image_data_format in ~/.keras/keras.json ?

TwistSun commented 4 years ago

What is you image_data_format in ~/.keras/keras.json ? This is the content in my keras.json: { "floatx": "float32", "epsilon": 1e-07, "backend": "tensorflow", "image_data_format": "channels_last" }

AliaksandrSiarohin commented 4 years ago

Is there is the same problem for all the other market checkpoints?

TwistSun commented 4 years ago

Is there is the same problem for all the other market checkpoints?

Hi, It is ok for checkpoint file 'generator-warp-mask.h5'. Which checkpoint should I use to test full model in the paper?

AliaksandrSiarohin commented 4 years ago

generator-warp-mask-nn3-cl12.h5 is the correct one. I just check it, run fine for me. What command you use to run?