Coder Social home page Coder Social logo

Comments (7)

goodfeli avatar goodfeli commented on August 26, 2024

@mahnerak can you fix this?

from cleverhans.

mahnerak avatar mahnerak commented on August 26, 2024

Using TensorFlow backend.

You need to somehow specify which backend to use for Keras. You have to either edit your keras.json config file or run every time like this
KERAS_BACKEND=theano python mnist_tutorial_th.py

from cleverhans.

goodfeli avatar goodfeli commented on August 26, 2024

Because the tutorial works only with the theano backend, you should use an if starement and change the backend if necessary, just as the tensorflow tutorial does

from cleverhans.

goodfeli avatar goodfeli commented on August 26, 2024

Or at least give a useful error message

from cleverhans.

mahnerak avatar mahnerak commented on August 26, 2024

Actually, the TensorFlow version of tutorial changes only image dimension ordering, not a backend for Keras.
If you run mnist_tutorial_tf.py with Keras configured theano as default backend, you'll get

Using Theano backend.
Using gpu device 0: GeForce GTX 980 (CNMeM is disabled, cuDNN 5005)
I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcublas.so.7.5 locally
I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcudnn.so.5 locally
I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcufft.so.7.5 locally
I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcurand.so.7.5 locally
INFO: '~/.keras/keras.json' sets 'image_dim_ordering' to 'th', temporarily setting to 'tf'
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
F tensorflow/stream_executor/cuda/cuda_driver.cc:334] current context was not created by the StreamExecutor cuda_driver API: 0x254a160; a CUDA runtime call was likely performed without using a StreamExecutor context
[1] 30067 abort (core dumped) KERAS_BACKEND=theano python mnist_tutorial_tf.py

from cleverhans.

mahnerak avatar mahnerak commented on August 26, 2024

Which one do you prefer? To assert that backend is correct, or change it manually?
If we decide to change backend during runtime, we have to do something like this before importing Keras
os.environ['KERAS_BACKEND']='tensorflow'
Don't know if it's a good idea.

from cleverhans.

goodfeli avatar goodfeli commented on August 26, 2024

from cleverhans.

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.