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

tensorflow and Keras errors #5

Open
khorshidisamira opened this issue Jul 6, 2021 · 2 comments
Open

tensorflow and Keras errors #5

khorshidisamira opened this issue Jul 6, 2021 · 2 comments

Comments

@khorshidisamira
Copy link

Hello,
I am trying to run your code but unfortunately there are a lot of errors to be solved, you have not specified the version of tensorflow, python and keras in your dependency file and after solving several errors, I have got to a point that I get the following:
Test accuracy on legitimate examples: 1.0000 Traceback (most recent call last): File "main.py", line 270, in <module> attack.main(attack_method=attack_method) File "/home/ijcnn19attacks-master/src/cleverhans_tutorials/tsc_tutorial_keras_tf.py", line 299, in main eps = ep) File "/home/ijcnn19attacks-master/src/cleverhans_tutorials/tsc_tutorial_keras_tf.py", line 221, in tsc_tutorial adv_x = fgsm.generate(x, **fgsm_params) File "/home/ijcnn19attacks-master/src/cleverhans_copy/attacks.py", line 298, in generate labels, nb_classes = self.get_or_guess_labels(x, kwargs) File "/home/ijcnn19attacks-master/src/cleverhans_copy/attacks.py", line 224, in get_or_guess_labels preds = self.model.get_probs(x) File "/home/ijcnn19attacks-master/src/cleverhans_copy/utils_keras.py", line 196, in get_probs return self.get_layer(x, name) File "/home/ijcnn19attacks-master/src/cleverhans_copy/utils_keras.py", line 245, in get_layer output = self.fprop(x) File "/home/ijcnn19attacks-master/src/cleverhans_copy/utils_keras.py", line 217, in fprop new_input = self.model.get_input_at(0) File "/home/ijcnn19attacks-master/ts_env/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer_v1.py", line 1520, in get_input_at 'input') File "/home/ijcnn19attacks-master/ts_env/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer_v1.py", line 2051, in _get_node_attribute_at_index 'and thus has no defined ' + attr_name + '.') RuntimeError: The layer has never been called and thus has no defined input.
Would you please let us know your python, TensorFlow and keras version? I had to change your code a lot to make it happen to get to this point!
Thanks

@GeYuYao-hub
Copy link

Hello, I am trying to run your code but unfortunately there are a lot of errors to be solved, you have not specified the version of tensorflow, python and keras in your dependency file and after solving several errors, I have got to a point that I get the following: Test accuracy on legitimate examples: 1.0000 Traceback (most recent call last): File "main.py", line 270, in <module> attack.main(attack_method=attack_method) File "/home/ijcnn19attacks-master/src/cleverhans_tutorials/tsc_tutorial_keras_tf.py", line 299, in main eps = ep) File "/home/ijcnn19attacks-master/src/cleverhans_tutorials/tsc_tutorial_keras_tf.py", line 221, in tsc_tutorial adv_x = fgsm.generate(x, **fgsm_params) File "/home/ijcnn19attacks-master/src/cleverhans_copy/attacks.py", line 298, in generate labels, nb_classes = self.get_or_guess_labels(x, kwargs) File "/home/ijcnn19attacks-master/src/cleverhans_copy/attacks.py", line 224, in get_or_guess_labels preds = self.model.get_probs(x) File "/home/ijcnn19attacks-master/src/cleverhans_copy/utils_keras.py", line 196, in get_probs return self.get_layer(x, name) File "/home/ijcnn19attacks-master/src/cleverhans_copy/utils_keras.py", line 245, in get_layer output = self.fprop(x) File "/home/ijcnn19attacks-master/src/cleverhans_copy/utils_keras.py", line 217, in fprop new_input = self.model.get_input_at(0) File "/home/ijcnn19attacks-master/ts_env/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer_v1.py", line 1520, in get_input_at 'input') File "/home/ijcnn19attacks-master/ts_env/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer_v1.py", line 2051, in _get_node_attribute_at_index 'and thus has no defined ' + attr_name + '.') RuntimeError: The layer has never been called and thus has no defined input. Would you please let us know your python, TensorFlow and keras version? I had to change your code a lot to make it happen to get to this point! Thanks

I also encountered this problem. Do you have a solution at present

@mahmoudaghvami
Copy link

Hello, I also encountered this problem.
Is there any solution now? @khorshidisamira @GeYuYao-hub @forestier @hfawaz

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

3 participants