GithubHelp home page GithubHelp logo

Comments (3)

davidsandberg avatar davidsandberg commented on May 1, 2024

The latest_filename that you provide in the call to get_checkpoint_state should not be the model itself but the name of a checkpoint file (which is a small text file and defaults to "checkpoint"). How to create this file is described in the README (and also below):

A model that has been train on a combination of FaceScrub and CASIA-Webface is available:
model-20160506.ckpt-500000
This model has been trained for 500 epochs (with a batch size of 90 images).
To load the model Tensorflow needs a checkpoint file in the same directory as the model file.
The checkpoint file is created when the model is stored (during training), but can also be created
with a text editor (see below). But remember to adjust the paths to point to your model file.
checkpoint:

model_checkpoint_path: "/home/david/models/facenet/model-20160506.ckpt-500000"
all_model_checkpoint_paths: "/home/david/models/facenet/model-20160506.ckpt-500000"

from facenet.

iqbalnaved avatar iqbalnaved commented on May 1, 2024

Ok, I have tried what you said. I created the checkpoint file in the same folder as the model file and passed the checkpoint file as an argument to get_checkpoint_state. But now new problem arises:

W tensorflow/core/framework/op_kernel.cc:936] Not found: Tensor name "incept4c/branch4_pool/conv1x1/biases" not found in checkpoint files /media/esb172/Hard_Disk_2/facenet_data/tightface/facenet-tf/facenet/models/model-20160506.ckpt-500000
[[Node: save/restore_slice_519 = RestoreSlice[dt=DT_FLOAT, preferred_shard=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/restore_slice_519/tensor_name, save/restore_slice_519/shape_and_slice)]]
E tensorflow/core/client/tensor_c_api.cc:485] Tensor name "incept4c/branch4_pool/conv1x1/biases" not found in checkpoint files /media/esb172/Hard_Disk_2/facenet_data/tightface/facenet-tf/facenet/models/model-20160506.ckpt-500000
[[Node: save/restore_slice_519 = RestoreSlice[dt=DT_FLOAT, preferred_shard=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/restore_slice_519/tensor_name, save/restore_slice_519/shape_and_slice)]]
[[Node: save/restore_slice_196/_1395 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/gpu:0", send_device="/job:localhost/replica:0/task:0/cpu:0", send_device_incarnation=1, tensor_name="edge_3507_save/restore_slice_196", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/gpu:0"]]
Traceback (most recent call last):
File "/media/esb172/Hard_Disk_2/facenet_data/tightface/facenet-tf/facenet/src/facenet_train.py", line 268, in
main(parse_arguments(sys.argv[1:]))
File "/media/esb172/Hard_Disk_2/facenet_data/tightface/facenet-tf/facenet/src/facenet_train.py", line 102, in main
saver.restore(sess, ckpt.model_checkpoint_path)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 1129, in restore
{self.saver_def.filename_tensor_name: save_path})
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 382, in run
run_metadata_ptr)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 655, in _run
feed_dict_string, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 723, in _do_run
target_list, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 743, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors.NotFoundError: Tensor name "incept4c/branch4_pool/conv1x1/biases" not found in checkpoint files /media/esb172/Hard_Disk_2/facenet_data/tightface/facenet-tf/facenet/models/model-20160506.ckpt-500000
[[Node: save/restore_slice_519 = RestoreSlice[dt=DT_FLOAT, preferred_shard=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/restore_slice_519/tensor_name, save/restore_slice_519/shape_and_slice)]]
[[Node: save/restore_slice_196/_1395 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/gpu:0", send_device="/job:localhost/replica:0/task:0/cpu:0", send_device_incarnation=1, tensor_name="edge_3507_save/restore_slice_196", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/gpu:0"]]
Caused by op u'save/restore_slice_519', defined at:
File "/media/esb172/Hard_Disk_2/facenet_data/tightface/facenet-tf/facenet/src/facenet_train.py", line 268, in
main(parse_arguments(sys.argv[1:]))
File "/media/esb172/Hard_Disk_2/facenet_data/tightface/facenet-tf/facenet/src/facenet_train.py", line 81, in main
saver = tf.train.Saver(tf.all_variables(), max_to_keep=0)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 861, in init
restore_sequentially=restore_sequentially)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 519, in build
filename_tensor, vars_to_save, restore_sequentially, reshape)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 272, in _AddRestoreOps
values = self.restore_op(filename_tensor, vs, preferred_shard)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 187, in restore_op
preferred_shard=preferred_shard)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/io_ops.py", line 203, in _restore_slice
preferred_shard, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_io_ops.py", line 359, in _restore_slice
preferred_shard=preferred_shard, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 703, in apply_op
op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2310, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1232, in init
self._traceback = _extract_stack()

Process finished with exit code 1

from facenet.

davidsandberg avatar davidsandberg commented on May 1, 2024

Closing this one since it looks like a duplicate of #34.

from facenet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.