taki0112 / UGATIT

Official Tensorflow implementation of U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization for Image-to-Image Translation (ICLR 2020)
MIT License
6.17k stars 1.04k forks source link

tensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [256,256] rhs shape= [1048576,256] #54

Closed zebiak closed 5 years ago

zebiak commented 5 years ago

[] Reading checkpoints... WARNING:tensorflow:From /root/anaconda3/lib/python3.7/site-packages/tensorflow/python/training/saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version. Instructions for updating: Use standard file APIs to check for files with this prefix. Traceback (most recent call last): File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1334, in _do_call return fn(args) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1319, in _run_fn options, feed_dict, fetch_list, target_list, run_metadata) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1407, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [256,256] rhs shape= [1048576,256] [[{{node save/Assign_105}}]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/training/saver.py", line 1276, in restore {self.saver_def.filename_tensor_name: save_path}) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 929, in run run_metadata_ptr) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1152, in _run feed_dict_tensor, options, run_metadata) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1328, in _do_run run_metadata) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1348, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [256,256] rhs shape= [1048576,256] [[node save/Assign_105 (defined at /root/UGATIT/UGATIT.py:619) ]]

Caused by op 'save/Assign_105', defined at: File "main.py", line 106, in main() File "main.py", line 102, in main gan.test() File "/root/UGATIT/UGATIT.py", line 619, in test self.saver = tf.train.Saver() File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/training/saver.py", line 832, in init self.build() File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/training/saver.py", line 844, in build self._build(self._filename, build_save=True, build_restore=True) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/training/saver.py", line 881, in _build build_save=build_save, build_restore=build_restore) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/training/saver.py", line 513, in _build_internal restore_sequentially, reshape) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/training/saver.py", line 354, in _AddRestoreOps assign_ops.append(saveable.restore(saveable_tensors, shapes)) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/training/saving/saveable_object_util.py", line 73, in restore self.op.get_shape().is_fully_defined()) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/state_ops.py", line 223, in assign validate_shape=validate_shape) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/gen_state_ops.py", line 64, in assign use_locking=use_locking, name=name) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper op_def=op_def) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func return func(*args, **kwargs) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op op_def=op_def) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 1801, in init self._traceback = tf_stack.extract_stack()

InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [256,256] rhs shape= [1048576,256] [[node save/Assign_105 (defined at /root/UGATIT/UGATIT.py:619) ]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "main.py", line 106, in main() File "main.py", line 102, in main gan.test() File "/root/UGATIT/UGATIT.py", line 620, in test could_load, checkpoint_counter = self.load(self.checkpoint_dir) File "/root/UGATIT/UGATIT.py", line 606, in load self.saver.restore(self.sess, os.path.join(checkpoint_dir, ckpt_name)) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/training/saver.py", line 1312, in restore err, "a mismatch between the current graph and the graph") tensorflow.python.framework.errors_impl.InvalidArgumentError: Restoring from checkpoint failed. This is most likely due to a mismatch between the current graph and the graph from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:

Assign requires shapes of both tensors to match. lhs shape= [256,256] rhs shape= [1048576,256] [[node save/Assign_105 (defined at /root/UGATIT/UGATIT.py:619) ]]

Caused by op 'save/Assign_105', defined at: File "main.py", line 106, in main() File "main.py", line 102, in main gan.test() File "/root/UGATIT/UGATIT.py", line 619, in test self.saver = tf.train.Saver() File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/training/saver.py", line 832, in init self.build() File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/training/saver.py", line 844, in build self._build(self._filename, build_save=True, build_restore=True) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/training/saver.py", line 881, in _build build_save=build_save, build_restore=build_restore) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/training/saver.py", line 513, in _build_internal restore_sequentially, reshape) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/training/saver.py", line 354, in _AddRestoreOps assign_ops.append(saveable.restore(saveable_tensors, shapes)) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/training/saving/saveable_object_util.py", line 73, in restore self.op.get_shape().is_fully_defined()) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/state_ops.py", line 223, in assign validate_shape=validate_shape) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/gen_state_ops.py", line 64, in assign use_locking=use_locking, name=name) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper op_def=op_def) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func return func(*args, **kwargs) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op op_def=op_def) File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 1801, in init self._traceback = tf_stack.extract_stack()

InvalidArgumentError (see above for traceback): Restoring from checkpoint failed. This is most likely due to a mismatch between the current graph and the graph from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:

Assign requires shapes of both tensors to match. lhs shape= [256,256] rhs shape= [1048576,256] [[node save/Assign_105 (defined at /root/UGATIT/UGATIT.py:619) ]]