Facenet: error when running Validate_on_lfw

Created on 22 Aug 2018  ยท  17Comments  ยท  Source: davidsandberg/facenet

I am new to the machine learning @davidsandberg
I am trying to run the (Validate_on_lfw .py) in windows but i get this error:

Model directory: pretrained_model
Metagraph file: model-20180402-114759.meta
Checkpoint file: model-20180402-114759.ckpt-275
Traceback (most recent call last):
File "C:\Users\user\Desktop\noor2\project2\facenet-master\facenet-master\src\validate_on_lfw.py", line 166, in
main(parse_arguments(sys.argv[1:]))
File "C:\Users\user\Desktop\noor2\project2\facenet-master\facenet-master\src\validate_on_lfw.py", line 75, in main
facenet.load_model("pretrained_model", input_map=input_map)
File "C:\Users\user\Desktop\noor2\project2\facenet-master\facenet-master\src\facenet.py", line 381, in load_model
saver = tf.train.import_meta_graph(os.path.join(model_exp, meta_file), input_map=input_map)
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\training\saver.py", line 1686, in import_meta_graph
**kwargs)
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\framework\meta_graph.py", line 504, in import_scoped_meta_graph
producer_op_list=producer_op_list)
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\framework\importer.py", line 283, in import_graph_def
raise ValueError('No op named %s in defined operations.' % node.op)
ValueError: No op named DecodeBmp in defined operations.

any help ?

Most helpful comment

image

@farimani thank you~

All 17 comments

hi @nonameever95 @davidsandberg ,

I met a similar situation like yours.
The process ended with an "Image Processing-Related" error.

KeyError is:
KeyError: "The name 'decode_image/cond_jpeg/is_png' refers to an Operation not in the graph."

Evironment is:
Ubuntu 16.04 64bit
tensorflow version: 1.10.0
CUDA 9.0
CUDNN 7.2

Directory tree:
(I use facenet and tensorflow in virtualenv)

โ”œโ”€โ”€ datasets
โ”‚ย ย  โ””โ”€โ”€ lfw
โ”‚ย ย  โ”œโ”€โ”€ lfw_mtcnnpy_160
โ”‚ย ย  โ””โ”€โ”€ raw
โ”œโ”€โ”€ facenet
โ”‚ย ย  โ”œโ”€โ”€ contributed
โ”‚ย ย  โ”œโ”€โ”€ data
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ images
โ”‚ย ย  โ”œโ”€โ”€ src
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ align
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ generative
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ models
โ”‚ย ย  โ”œโ”€โ”€ test
โ”‚ย ย  โ”œโ”€โ”€ tmp
โ”‚ย ย  โ””โ”€โ”€ util
โ”œโ”€โ”€ models
โ”‚ย ย  โ””โ”€โ”€ facenet
โ”‚ย ย  โ””โ”€โ”€ 20180402-114759
โ””โ”€โ”€ venv
โ”œโ”€โ”€ bin
โ”œโ”€โ”€ include
โ”‚ย ย  โ””โ”€โ”€ python2.7 -> /usr/include/python2.7
โ”œโ”€โ”€ lib
โ”‚ย ย  โ””โ”€โ”€ python2.7
โ”œโ”€โ”€ local
โ”‚ย ย  โ”œโ”€โ”€ bin -> /home/oesys2018/tensorflowEnv/venv/bin
โ”‚ย ย  โ”œโ”€โ”€ include -> /home/oesys2018/tensorflowEnv/venv/include
โ”‚ย ย  โ””โ”€โ”€ lib -> /home/oesys2018/tensorflowEnv/venv/lib
โ””โ”€โ”€ share
โ””โ”€โ”€ python-wheels

Hope someone can help.
Thanks.

This problem is solved !
The error was due to the version of tensorflow
So the model was build using a different version than the one I was using
I had tensorflow 1.5
So i install tensorflow 1.3 and it worked !

same.

I install tensorflow1.7 and it worked.

I also have the same problem, how can it be compatible to tensorflow 1.10?

@karlTUM

Just install another version of Tensorflow. According the facenet github web suggesttion, use r1.7
I had tried r1.10 and it went failed.

The same. I instal tensorflow 1.7 , it works!!!! Thanks for everyone's advice.

@QCurry
Just run it with TF 1.12 successfully.
Your issue can be solved by adding a name scope around the entire facenet.create_input_pipeline function.
The bug is because the code uses import_meta_graph to create the graph on top of an existing graph. This usage is error-prone due to potential name conflicts.

I trained a model on my GPU and trying to run validate_lfw there only.
I am still running into issues. There should be no TF version mismatch in my case.

Thank you @ppwwyyxx! Putting the body of facenet.create_input_pipeline in a with tf.name_scope("tempscope"): or with tf.Graph().as_default(): block fixes it (Tensorflow 1.10).

image

@farimani thank you~

Thank you @ppwwyyxx ! Adding a name scope around the entire facenet.create_input_pipeline function also works on tf1.12

Thank you @ppwwyyxx ! It works on tf 1.12

Yes I can also confirm @ppwwyyxx solution worked on my own installation of tf 1.12

Thanks so much @ppwwyyxx ! The solution works on tf 1.13 of my own (virtual env)

I implemented the solution of @VictorZhang2014 and it work for me, using tensorflow 1.13.1

@VictorZhang2014 .. thanks ... it also work foe me..

I also implemented the solution of @VictorZhang2014 and it worked for me, using tensorflow 1.12.0, python 2.7 on ubuntu 20 version.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RaviRaaja picture RaviRaaja  ยท  3Comments

MaartenBloemen picture MaartenBloemen  ยท  3Comments

allahbaksh picture allahbaksh  ยท  3Comments

mayank26saxena picture mayank26saxena  ยท  4Comments

Leedonggeon picture Leedonggeon  ยท  3Comments