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

CKPT_model #4

Open
ArthurConan opened this issue Apr 3, 2018 · 3 comments
Open

CKPT_model #4

ArthurConan opened this issue Apr 3, 2018 · 3 comments

Comments

@ArthurConan
Copy link

Hello again, I really enjoy your program
But can you help me with such question: this tool works with ImageNet model ".pb"
But is it possible to import "model.ckpt" ?
Thanks in advance

@huanzhang12
Copy link
Owner

Yes it is possible. You can convert a "model.ckpt" to a ".pb". You can follow the "How to evaluate my own model" section in this tutorial on my other repository:
https://github.com/huanzhang12/CLEVER

@ArthurConan
Copy link
Author

ArthurConan commented Apr 3, 2018

sorry for bothering you
i want to test by your ZOO attack the model "ens_adv_inception_resnet_v2_2017_08_18.tar.gz"

but i tried to use your tutorial and failed
and tried to convert by tensorflow export_inference_graph.py file and also failed
cause i get such error

File "test_all.py", line 262, in
main(args)
File "test_all.py", line 102, in main
data, model = ImageNet(), InceptionModel(sess, use_log)
File "/root/Documents/python/ZOO-Attack-master/setup_inception.py", line 225, in init
self.model = InceptionModelPrediction(sess, use_log)
File "/root/Documents/python/ZOO-Attack-master/setup_inception.py", line 192, in init
return_elements=[output_name])
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/util/deprecation.py", line 432, in new_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/importer.py", line 753, in import_graph_def
% ', '.join(absent_input_keys))
ValueError: Attempted to map inputs that were not found in graph_def: [input:0]

@huanzhang12
Copy link
Owner

If you are able to generate the frozen probobuf, you are very close to your goal :)

You need to change the input name in line 173, 221 and 227 in setup_inception.py and replace the "input:0" to the input tensor name that you observed in TensorBoard for you model. You also need to do the same for all the output nodes (like "InceptionV3/Predictions/Softmax:0" and "InceptionV3/Predictions/Reshape:0"). Replace them with the name of output nodes of your new graph. The current names are for inception v3 only.

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

2 participants