Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when running Validate_on_lfw #852

Closed
nonameever95 opened this issue Aug 22, 2018 · 17 comments
Closed

error when running Validate_on_lfw #852

nonameever95 opened this issue Aug 22, 2018 · 17 comments

Comments

@nonameever95
Copy link

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 ?

@QCurry
Copy link

QCurry commented Aug 23, 2018

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.

@nonameever95
Copy link
Author

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 !

@QCurry
Copy link

QCurry commented Aug 26, 2018

same.

I install tensorflow1.7 and it worked.

@jiankang1991
Copy link

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

@QCurry
Copy link

QCurry commented Sep 10, 2018

@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.

@IFlyToMe
Copy link

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

@ppwwyyxx
Copy link

@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.

@divyanshpal
Copy link

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.

@kilinitt
Copy link

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).

@VictorZhang2014
Copy link

image

@farimani thank you~

@AskyJx
Copy link

AskyJx commented Dec 26, 2018

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

@rockdodos
Copy link

Thank you @ppwwyyxx ! It works on tf 1.12

@JesusCoyotzi
Copy link

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

@GodCC6
Copy link

GodCC6 commented May 16, 2019

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

@jorge190588
Copy link

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

@msiraj83
Copy link

msiraj83 commented Oct 2, 2019

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

@TataMoktari
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests