Code Monkey home page Code Monkey logo

Comments (4)

pooyanjamshidi avatar pooyanjamshidi commented on July 21, 2024

Sure, @MENG2010 please post the logs here.

from athena.

MENG2010 avatar MENG2010 commented on July 21, 2024
INFO: compile model using customized metrics.
Traceback (most recent call last):
  File "scripts.py", line 298, in <module>
    tf.app.run()
  File "/opt/DL/tensorflow/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run
    _sys.exit(main(argv))
  File "scripts.py", line 280, in main
    generate_adversarial_examples(DATA.mnist, ATTACK.FGSM)
  File "scripts.py", line 124, in generate_adversarial_examples
    X_adv, _ = get_adversarial_examples(model_name, method, X, Y, eps=eps)
  File "/home/ymeng/advML/attacks/attacker.py", line 30, in get_adversarial_examples
    X_adv, Y = whitebox.generate(model_name, X, Y, attack_method, attack_params)
  File "/home/ymeng/advML/attacks/whitebox.py", line 170, in generate
    metrics=['accuracy', adv_accuracy_metric]
  File "/opt/DL/tensorflow/lib/python3.6/site-packages/tensorflow/python/training/checkpointable/base.py", line 474, in _method_wrapper
    method(self, *args, **kwargs)
  File "/opt/DL/tensorflow/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 648, in compile
    sample_weights=self.sample_weights)
  File "/opt/DL/tensorflow/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 313, in _handle_metrics
    output, output_mask))
  File "/opt/DL/tensorflow/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 270, in _handle_per_output_metrics
    y_true, y_pred, weights=weights, mask=mask)
  File "/opt/DL/tensorflow/lib/python3.6/site-packages/tensorflow/python/keras/engine/training_utils.py", line 598, in weighted
    score_array = fn(y_true, y_pred)
  File "/home/ymeng/advML/attacks/whitebox.py", line 228, in adv_acc
    x_adv = attacker.generate(model.input, **attack_params)
  File "/opt/anaconda3/lib/python3.6/site-packages/cleverhans/attacks.py", line 342, in generate
    labels, _nb_classes = self.get_or_guess_labels(x, kwargs)
  File "/opt/anaconda3/lib/python3.6/site-packages/cleverhans/attacks.py", line 281, in get_or_guess_labels
    preds = self.model.get_probs(x)
  File "/opt/anaconda3/lib/python3.6/site-packages/cleverhans/utils_keras.py", line 179, in get_probs
    return self.get_layer(x, name)
  File "/opt/anaconda3/lib/python3.6/site-packages/cleverhans/utils_keras.py", line 227, in get_layer
    output = self.fprop(x)
  File "/opt/anaconda3/lib/python3.6/site-packages/cleverhans/utils_keras.py", line 203, in fprop
    self.keras_model = KerasModel(new_input, out_layers)
  File "/opt/anaconda3/lib/python3.6/site-packages/Keras-2.2.4-py3.6.egg/keras/legacy/interfaces.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "/opt/anaconda3/lib/python3.6/site-packages/Keras-2.2.4-py3.6.egg/keras/engine/network.py", line 94, in __init__
    self._init_graph_network(*args, **kwargs)
  File "/opt/anaconda3/lib/python3.6/site-packages/Keras-2.2.4-py3.6.egg/keras/engine/network.py", line 253, in _init_graph_network
    input_shapes=[x._keras_shape for x in self.inputs],
  File "/opt/anaconda3/lib/python3.6/site-packages/Keras-2.2.4-py3.6.egg/keras/engine/network.py", line 253, in <listcomp>
    input_shapes=[x._keras_shape for x in self.inputs],
AttributeError: 'Tensor' object has no attribute '_keras_shape'

from athena.

MENG2010 avatar MENG2010 commented on July 21, 2024

some said this AttributeError was caused by mixed usage of keras.model with tensorflow.keras.model. However, we only use tensorflow.keras.model package in our codes.

https://stackoverflow.com/questions/51515929/attributeerror-tensor-object-has-no-attribute-keras-shape-when-creating-a?rq=1

https://stackoverflow.com/questions/54614299/tensor-object-has-no-attribute-keras-shape

from athena.

MENG2010 avatar MENG2010 commented on July 21, 2024

Should be the same issue one google cloud platform.
#9

from athena.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.