Comments (3)
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.
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.
Closing this one since it looks like a duplicate of #34.
from facenet.
Related Issues (20)
- command not found error (while trying align the LFW dataset)
- ValueError: Node 'gradients/InceptionResnetV1/Bottleneck/BatchNorm/cond/FusedBatchNorm_1_grad/FusedBatchNormGrad' has an _output_shapes attribute inconsistent with the GraphDef for output #3: Dimension 0 in both shapes must be equal, but are 0 and 512. Shapes are [0] and [512]. HOT 4
- TypeError: true_fn and false_fn arguments to tf.cond must have the same number, type, and overall structure of return values
- does facenet support docker HOT 1
- About tensorflow -v2.8.0, I have a error. HOT 1
- Validation loss
- ve
- How to make inference on a single image? HOT 1
- Bounding box is inaccurate HOT 2
- Error in Loading checkpoint file for facenet512
- Unable to open file (file signature not found) HOT 1
- CASIA Webface Dataset Link Needs Updating
- Incorrect bounding box
- Issue with Tensor Names in DeepSORT Integration with FaceNET Model
- Unable to use .pb in tensorflow's java api
- Unable to convert onnx model to TRT model
- ValueError: Node 'gradients/InceptionResnetV1/Bottleneck/BatchNorm/cond/FusedBatchNorm_1_grad/FusedBatchNormGrad' has an _output_shapes attribute inconsistent with the GraphDef for output #3: Dimension 0 in both shapes must be equal, but are 0 and 512. Shapes are [0] and [512]. HOT 1
- Request for Weight Files in faceswap-GAN Project
- How to add visualization to train_tripletloss.py
- Find
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from facenet.