Joker316701882 / Additive-Margin-Softmax

This is the implementation of paper <Additive Margin Softmax for Face Verification>
492 stars 149 forks source link

can't load saved model #8

Closed yc-huang closed 6 years ago

yc-huang commented 6 years ago

when set arg 'pretrained_model' to the path of some saved model, it will complain with errors:

Caused by op u'save/RestoreV2_54', defined at: File "train.py", line 528, in main(parse_arguments(sys.argv[1:])) File "train.py", line 162, in main saver_load = tf.train.Saver(tf.trainable_variables(), max_to_keep=1) File "/home/td/anaconda2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1218, in init self.build() File "/home/td/anaconda2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1227, in build self._build(self._filename, build_save=True, build_restore=True) File "/home/td/anaconda2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1263, in _build build_save=build_save, build_restore=build_restore) File "/home/td/anaconda2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 751, in _build_internal restore_sequentially, reshape) File "/home/td/anaconda2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 427, in _AddRestoreOps tensors = self.restore_op(filename_tensor, saveable, preferred_shard) File "/home/td/anaconda2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 267, in restore_op [spec.tensor.dtype])[0]) File "/home/td/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/gen_io_ops.py", line 1021, in restore_v2 shape_and_slices=shape_and_slices, dtypes=dtypes, name=name) File "/home/td/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "/home/td/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2956, in create_op op_def=op_def) File "/home/td/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1470, in init self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

NotFoundError (see above for traceback): Unsuccessful TensorSliceReader constructor: Failed to find any matching files for ./trained_model/20180409-183909/ [[Node: save/RestoreV2_54 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2_54/tensor_names, save/RestoreV2_54/shape_and_slices)]] [[Node: save/RestoreV2_7/_497 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_490_save/RestoreV2_7", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]

yc-huang commented 6 years ago

solved. you should specify the path to the index file, but without the .index