tensorlayer / SRGAN

Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network
https://github.com/tensorlayer/tensorlayerx
3.32k stars 813 forks source link

ValueError: Shapes (1, 1, 1, 64) and (64,) are incompatible #195

Open Veselov-Ivan opened 4 years ago

Veselov-Ivan commented 4 years ago

Hello! After training on DIV2K dataset I run

python3 train.py --mode evaluate

command, but got the following error:

2019-11-29 20:23:43.754143: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2019-11-29 20:23:43.777485: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 1800000000 Hz 2019-11-29 20:23:43.778256: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x55a799583400 executing computations on platform Host. Devices: 2019-11-29 20:23:43.778281: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): Host, Default Version Traceback (most recent call last): File "train.py", line 205, in evaluate() File "train.py", line 173, in evaluate G.load_weights(os.path.join(checkpoint_dir, 'g.h5')) File "/home/ivan/anaconda3/lib/python3.7/site-packages/tensorlayer/models/core.py", line 921, in load_weights utils.load_hdf5_to_weights_in_order(filepath, self) File "/home/ivan/anaconda3/lib/python3.7/site-packages/tensorlayer/files/utils.py", line 2730, in load_hdf5_to_weights_in_order _load_weights_from_hdf5_group_in_order(f, network.all_layers) File "/home/ivan/anaconda3/lib/python3.7/site-packages/tensorlayer/files/utils.py", line 2623, in _load_weights_from_hdf5_group_in_order assign_tf_variable(layer.all_weights[iid], np.asarray(g[w_name])) File "/home/ivan/anaconda3/lib/python3.7/site-packages/tensorlayer/files/utils.py", line 2553, in assign_tf_variable variable.assign(value) File "/home/ivan/anaconda3/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 "/home/ivan/anaconda3/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 (1, 1, 1, 64) and (64,) are incompatible

Could you please tell me how can I fix it? Thank you!

bokutotu commented 4 years ago

I have same problem