tensorflow = 2.2.0 python = 3.7
when I run, prog run till base.save
While run tf.compat.v1.train.Saver(), it hint
File "main.py", line 131, in <module> main() File "main.py", line 113, in main T.train() File "/home/yang/Documents/paper/refer/MGNN-SPred-master/Train.py", line 40, in train self.model.save() File "/home/yang/Documents/paper/refer/MGNN-SPred-master/models/base.py", line 116, in save self.saver.save(self.sess, name) File "/home/yang/anaconda3/envs/tsorflw/lib/python3.7/site-packages/tensorflow/python/training/saver.py", line 1180, in save checkpoint_file, build_save=True, build_restore=False) File "/home/yang/anaconda3/envs/tsorflw/lib/python3.7/site-packages/tensorflow/python/training/saver.py", line 852, in _build_eager checkpoint_path, build_save=build_save, build_restore=build_restore) File "/home/yang/anaconda3/envs/tsorflw/lib/python3.7/site-packages/tensorflow/python/training/saver.py", line 886, in _build build_restore=build_restore) File "/home/yang/anaconda3/envs/tsorflw/lib/python3.7/site-packages/tensorflow/python/training/saver.py", line 490, in _build_internal names_to_saveables) File "/home/yang/anaconda3/envs/tsorflw/lib/python3.7/site-packages/tensorflow/python/training/saving/saveable_object_util.py", line 360, in validate_and_slice_inputs for converted_saveable_object in saveable_objects_for_op(op, name): File "/home/yang/anaconda3/envs/tsorflw/lib/python3.7/site-packages/tensorflow/python/training/saving/saveable_object_util.py", line 209, in saveable_objects_for_op "executing eagerly, got type: %s." % type(op)) ValueError: Can only save/restore ResourceVariables when executing eagerly, got type: <class 'tensorflow.python.framework.ops.Tensor'>.
I change some tf1 code to tf2. Is it wrong? Where?
But I can't figure out where the problem is. Plz help me