Git Product home page Git Product logo

Comments (7)

rasbt avatar rasbt commented on May 23, 2024

Hi, there,

Does the problem only occur when you are running the code/notebook via GPU (i.e., does it work okay on CPU?).

Maybe try to run this snippet as a .py script instead of the notebook for further debugging of the issue. However, based on my experience, a restarting kernel is often related to memory issues, so maybe this wouldn't help.

However, I would maybe try it

THEANO_FLAGS=device=gpu,floatX=float32 python your_script.py

and

THEANO_FLAGS=device=cpu,floatX=float64 python your_script.py

to find out more

from python-machine-learning-book.

BingKong1988 avatar BingKong1988 commented on May 23, 2024

THEANO_FLAGS=device=gpu,floatX=float32
this setting does solve the problem. I was using THEANO_FLAGS=device=cuda,floatX=float32, which allows the gpu test code here http://deeplearning.net/software/theano/tutorial/using_gpu.html to run. I am wondering if there is any difference between those two settings.
Also it seems like there is no show_accuracy in keras.models.Sequential

Thanks

from python-machine-learning-book.

rasbt avatar rasbt commented on May 23, 2024

Thanks for the note about Keras; that's been the old syntax that has been deprecated. I changed it to make it Keras 2 compatible (see notebook here: https://github.com/rasbt/python-machine-learning-book/blob/master/code/ch13/ch13.ipynb)

As for Theano, not sure what causes this issue. From their website

Using the GPU in Theano is as simple as setting the device configuration flag to device=cuda (or device=gpu for the old backend (http://deeplearning.net/software/theano/tutorial/using_gpu.html)

Have you seen any meaningful error messages in the command line when you ran

THEANO_FLAGS=device=cuda,floatX=float32 python your_script.py

?

from python-machine-learning-book.

BingKong1988 avatar BingKong1988 commented on May 23, 2024

fatal error: cudnn.h: No such file or directory\r\ncompilation terminated.\r\n'
Mapped name None to device cuda: GeForce GTX 660 (0000:01:00.0)
Using Theano backend.

I do get this error before python crushed.

from python-machine-learning-book.

BingKong1988 avatar BingKong1988 commented on May 23, 2024

And I just noticed that using this setting:
THEANO_FLAGS=device=gpu,floatX=float32 python your_script.py
can make the code up and running, but it is actually still using cpu

from python-machine-learning-book.

rasbt avatar rasbt commented on May 23, 2024

Hm, sounds like it's having issues with recognizing the cuda/cudnn installation? This might be a general theano setup problem. Maybe, you can find some useful information in their guide at http://deeplearning.net/software/theano/install.html

from python-machine-learning-book.

BingKong1988 avatar BingKong1988 commented on May 23, 2024

Thank you!

from python-machine-learning-book.

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.