Skip to content

OP_REQUIRES failed at save_restore_v2_ops.cc:184 : Not found: Key MobileFaceNet/Conv2d_0/prelu_alphas not found in checkpoint #3

@ChenjingYu1993

Description

@ChenjingYu1993

my tensorflow version is 1.9, when i reload the pretrained model you provided to train the network, some error occured.
the log is below:
`Restoring pretrained model: ./pretrained
model_checkpoint_path: "./pretrained/MobileFaceNet_epoch_4_iter_16000.ckpt"
all_model_checkpoint_paths: "./pretrained/MobileFaceNet_epoch_2_iter_14000.ckpt"
all_model_checkpoint_paths: "./pretrained/MobileFaceNet_epoch_2_iter_16000.ckpt"
all_model_checkpoint_paths: "./pretrained/MobileFaceNet_epoch_2_iter_18000.ckpt"
all_model_checkpoint_paths: "./pretrained/MobileFaceNet_epoch_3_iter_2000.ckpt"
all_model_checkpoint_paths: "./pretrained/MobileFaceNet_epoch_3_iter_4000.ckpt"
all_model_checkpoint_paths: "./pretrained/MobileFaceNet_epoch_3_iter_6000.ckpt"
all_model_checkpoint_paths: "./pretrained/MobileFaceNet_epoch_3_iter_8000.ckpt"
all_model_checkpoint_paths: "./pretrained/MobileFaceNet_epoch_3_iter_10000.ckpt"
all_model_checkpoint_paths: "./pretrained/MobileFaceNet_epoch_3_iter_12000.ckpt"
all_model_checkpoint_paths: "./pretrained/MobileFaceNet_epoch_3_iter_14000.ckpt"
all_model_checkpoint_paths: "./pretrained/MobileFaceNet_epoch_3_iter_16000.ckpt"
all_model_checkpoint_paths: "./pretrained/MobileFaceNet_epoch_3_iter_18000.ckpt"
all_model_checkpoint_paths: "./pretrained/MobileFaceNet_epoch_4_iter_2000.ckpt"
all_model_checkpoint_paths: "./pretrained/MobileFaceNet_epoch_4_iter_4000.ckpt"
all_model_checkpoint_paths: "./pretrained/MobileFaceNet_epoch_4_iter_6000.ckpt"
all_model_checkpoint_paths: "./pretrained/MobileFaceNet_epoch_4_iter_8000.ckpt"
all_model_checkpoint_paths: "./pretrained/MobileFaceNet_epoch_4_iter_10000.ckpt"
all_model_checkpoint_paths: "./pretrained/MobileFaceNet_epoch_4_iter_12000.ckpt"
all_model_checkpoint_paths: "./pretrained/MobileFaceNet_epoch_4_iter_14000.ckpt"
all_model_checkpoint_paths: "./pretrained/MobileFaceNet_epoch_4_iter_16000.ckpt"

2018-11-22 14:27:02.256646: W tensorflow/core/framework/op_kernel.cc:1318] OP_REQUIRES failed at save_restore_v2_ops.cc:184 : Not found: Key MobileFaceNet/Conv2d_0/prelu_alphas not found in checkpoint
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1322, in _do_call
return fn(*args)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1307, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1409, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.NotFoundError: Key MobileFaceNet/Conv2d_0/prelu_alphas not found in checkpoint
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "train_nets.py", line 202, in
saver.restore(sess, ckpt.model_checkpoint_path)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 1768, in restore
six.reraise(exception_type, exception_value, exception_traceback)
File "/usr/lib/python3/dist-packages/six.py", line 686, in reraise
raise value
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 1752, in restore
{self.saver_def.filename_tensor_name: save_path})
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 900, in run
run_metadata_ptr)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1135, in _run
feed_dict_tensor, options, run_metadata)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1316, in _do_run
run_metadata)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1335, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.NotFoundError: Key MobileFaceNet/Conv2d_0/prelu_alphas not found in checkpoint
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

Caused by op 'save/RestoreV2', defined at:
File "train_nets.py", line 191, in
saver = tf.train.Saver(tf.trainable_variables(), max_to_keep=args.saver_maxkeep)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 1284, in init
self.build()
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 1296, in build
self._build(self._filename, build_save=True, build_restore=True)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 1333, in _build
build_save=build_save, build_restore=build_restore)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 781, in _build_internal
restore_sequentially, reshape)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 400, in _AddRestoreOps
restore_sequentially)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 832, in bulk_restore
return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/gen_io_ops.py", line 1463, in restore_v2
shape_and_slices=shape_and_slices, dtypes=dtypes, name=name)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 3414, in create_op
op_def=op_def)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 1740, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

NotFoundError (see above for traceback): Key MobileFaceNet/Conv2d_0/prelu_alphas not found in checkpoint
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]`

i don't know what happened, can you help me? thx~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions