Last Updated on September 17, 2020
It can be difficult to install a Python machine learning environment on some platforms.
Python itself must be installed first and then there are many packages to install, and it can be confusing for beginners.
In this tutorial, you will discover how to set up a Python machine learning development environment using Anaconda.
After completing this tutorial, you will have a working Python environment to begin learning, practicing, and developing machine learning and deep learning software.
These instructions are suitable for Windows, Mac OS X, and Linux platforms. I will demonstrate them on OS X, so you may see some mac dialogs and file extensions.
Kick-start your project with my new book Machine Learning Mastery With Python, including step-by-step tutorials and the Python source code files for all examples.
Let’s get started.
- Update Mar/2017: Added note that you only need one of Theano or TensorFlow to use Keras for Deep Learning.

How to Setup a Python Environment for Machine Learning and Deep Learning with Anaconda
Overview
In this tutorial, we will cover the following steps:
- Download Anaconda
- Install Anaconda
- Start and Update Anaconda
- Update scikit-learn Library
- Install Deep Learning Libraries
1. Download Anaconda
In this step, we will download the Anaconda Python package for your platform.
Anaconda is a free and easy-to-use environment for scientific Python.
- 1. Visit the Anaconda homepage.
- 2. Click “Anaconda” from the menu and click “Download” to go to the download page.

Click Anaconda and Download
- 3. Choose the download suitable for your platform (Windows, OSX, or Linux):
- Choose Python 3.5
- Choose the Graphical Installer

Choose Anaconda Download for Your Platform
This will download the Anaconda Python package to your workstation.
I’m on OS X, so I chose the OS X version. The file is about 426 MB.
You should have a file with a name like:
1 |
Anaconda3-4.2.0-MacOSX-x86_64.pkg |
2. Install Anaconda
In this step, we will install the Anaconda Python software on your system.
This step assumes you have sufficient administrative privileges to install software on your system.
- 1. Double click the downloaded file.
- 2. Follow the installation wizard.

Anaconda Python Installation Wizard
Installation is quick and painless.
There should be no tricky questions or sticking points.

Anaconda Python Installation Wizard Writing Files
The installation should take less than 10 minutes and take up a little more than 1 GB of space on your hard drive.
3. Start and Update Anaconda
In this step, we will confirm that your Anaconda Python environment is up to date.
Anaconda comes with a suite of graphical tools called Anaconda Navigator. You can start Anaconda Navigator by opening it from your application launcher.

Anaconda Navigator GUI
You can learn all about the Anaconda Navigator here.
You can use the Anaconda Navigator and graphical development environments later; for now, I recommend starting with the Anaconda command line environment called conda.
Conda is fast, simple, it’s hard for error messages to hide, and you can quickly confirm your environment is installed and working correctly.
- 1. Open a terminal (command line window).
- 2. Confirm conda is installed correctly, by typing:
1 |
conda -V |
You should see the following (or something similar):
1 |
conda 4.2.9 |
- 3. Confirm Python is installed correctly by typing:
1 |
python -V |
You should see the following (or something similar):
1 |
Python 3.5.2 :: Anaconda 4.2.0 (x86_64) |

Confirm Conda and Python are Installed
If the commands do not work or have an error, please check the documentation for help for your platform.
See some of the resources in the “Further Reading” section.
- 4. Confirm your conda environment is up-to-date, type:
1 2 |
conda update conda conda update anaconda |
You may need to install some packages and confirm the updates.
- 5. Confirm your SciPy environment.
The script below will print the version number of the key SciPy libraries you require for machine learning development, specifically: SciPy, NumPy, Matplotlib, Pandas, Statsmodels, and Scikit-learn.
You can type “python” and type the commands in directly. Alternatively, I recommend opening a text editor and copy-pasting the script into your editor.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# scipy import scipy print('scipy: %s' % scipy.__version__) # numpy import numpy print('numpy: %s' % numpy.__version__) # matplotlib import matplotlib print('matplotlib: %s' % matplotlib.__version__) # pandas import pandas print('pandas: %s' % pandas.__version__) # statsmodels import statsmodels print('statsmodels: %s' % statsmodels.__version__) # scikit-learn import sklearn print('sklearn: %s' % sklearn.__version__) |
Save the script as a file with the name: versions.py.
On the command line, change your directory to where you saved the script and type:
1 |
python versions.py |
You should see output like the following:
1 2 3 4 5 6 |
scipy: 0.18.1 numpy: 1.11.1 matplotlib: 1.5.3 pandas: 0.18.1 statsmodels: 0.6.1 sklearn: 0.17.1 |
What versions did you get?
Paste the output in the comments below.

Confirm Anaconda SciPy environment
4. Update scikit-learn Library
In this step, we will update the main library used for machine learning in Python called scikit-learn.
- 1. Update scikit-learn to the latest version.
At the time of writing, the version of scikit-learn shipped with Anaconda is out of date (0.17.1 instead of 0.18.1). You can update a specific library using the conda command; below is an example of updating scikit-learn to the latest version.
At the terminal, type:
1 |
conda update scikit-learn |

Update scikit-learn in Anaconda
Alternatively, you can update a library to a specific version by typing:
1 |
conda install -c anaconda scikit-learn=0.18.1 |
Confirm the installation was successful and scikit-learn was updated by re-running the versions.py script by typing:
1 |
python versions.py |
You should see output like the following:
1 2 3 4 5 6 |
scipy: 0.18.1 numpy: 1.11.3 matplotlib: 1.5.3 pandas: 0.18.1 statsmodels: 0.6.1 sklearn: 0.18.1 |
What versions did you get?
Paste the output in the comments below.
You can use these commands to update machine learning and SciPy libraries as needed.
Try a scikit-learn tutorial, such as:
5. Install Deep Learning Libraries
In this step, we will install Python libraries used for deep learning, specifically: Theano, TensorFlow, and Keras.
NOTE: I recommend using Keras for deep learning and Keras only requires one of Theano or TensorFlow to be installed. You do not need both! There may be problems installing TensorFlow on some Windows machines.
- 1. Install the Theano deep learning library by typing:
1 |
conda install theano |
- 2. Install the TensorFlow deep learning library (all except Windows) by typing:
1 |
conda install -c conda-forge tensorflow |
Alternatively, you may choose to install using pip and a specific version of tensorflow for your platform.
See the installation instructions for tensorflow.
- 3. Install Keras by typing:
1 |
pip install keras |
- 4. Confirm your deep learning environment is installed and working correctly.
Create a script that prints the version numbers of each library, as we did before for the SciPy environment.
1 2 3 4 5 6 7 8 9 |
# theano import theano print('theano: %s' % theano.__version__) # tensorflow import tensorflow print('tensorflow: %s' % tensorflow.__version__) # keras import keras print('keras: %s' % keras.__version__) |
Save the script to a file deep_versions.py. Run the script by typing:
1 |
python deep_versions.py |
You should see output like:
1 2 3 4 |
theano: 0.8.2.dev-901275534cbfe3fbbe290ce85d1abf8bb9a5b203 tensorflow: 0.12.1 Using TensorFlow backend. keras: 1.2.1 |

Anaconda Confirm Deep Learning Libraries
What versions did you get?
Paste your output in the comments below.
Try a Keras deep learning tutorial, such as:
Further Reading
This section provides some links for further reading.
- Anaconda Documentation
- Anaconda Documentation: Installation
- Conda
- Using conda
- Anaconda Navigator
- Installing Theano
- Install TensorFlow Anaconda
- Keras Installation
Summary
Congratulations, you now have a working Python development environment for machine learning and deep learning.
You can now learn and practice machine learning and deep learning on your workstation.
How did you go?
Let me know in the comments below.
Here is my output after installation:
theano: 0.8.2
tensorflow: 1.0.1
Using TensorFlow backend.
keras: 1.2.2
Very nice!
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.0.0
Using TensorFlow backend.
keras: 2.0.3
Very nice work Nitin.
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 0.12.1
Using TensorFlow backend.
keras: 2.0.5
Nice work Shirley.
How can I install wordcloud and gensim in python 3.7
i saw this “syntax invalid syntax
What did you type and where did you type it?
sir Jason im very new about machne learning please guide me how cani started thank you!
My best advice for getting stared is right here:
https://machinelearningmastery.com/start-here/#getstarted
I got the following warning when I tried to see deep versions
python deep_versions.py
WARNING (theano.configdefaults): Only clang++ is supported. With g++, we end up with strange g++/OSX bugs.
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.3.0
Using TensorFlow backend.
keras: 2.1.1
Perhaps ignore these warnings and focus on using the tensorflow backend?
Dear sir,
I want to implement the deep learning for the wireless communication dataset that I have. I want to train it and predict the results. Please advise.
I recommend this process to work through your problem systematically:
https://machinelearningmastery.com/start-here/#process
scipy: 1.1.0
numpy: 1.15.2
matplotlib: 3.0.0
pandas: 0.23.4
statsmodels: 0.9.0
sklearn: 0.20.0
Well done!
I m using windows and I installed both theano and TensorFlow on my PC would that cause any problem?
No, it should not. But Theano stopped development and phased out by Keras. Rather than strictly following the guide here (which was written a few years ago), try to install the latest version of Tensorflow only. Everything else should be just fine.
One of the amazing documentation on Machine Learning. Thanks a lot.
Thanks Deepak.
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.3.0
Using TensorFlow backend.
keras: 2.0.8
Great work Dustin!
Hello Jason,
I am getting a couple of warnings:
theano: 1.0.1
tensorflow: 1.0.0
Using TensorFlow backend.
keras: 2.1.5
Thank you
Nice work!
tensorflow: 1.1.0
/anaconda3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from
float
tonp.floating
is deprecated. In future, it will be treated asnp.float64 == np.dtype(float).type
.from ._conv import register_converters as _register_converters
Using TensorFlow backend.
keras: 2.2.0
Well done!
/usr/bin/python3.5 /home/jeff/pythonPrograms/versions.py
scipy: 0.17.0
numpy: 1.13.1
matplotlib: 1.5.1
pandas: 0.20.3
sklearn: 0.19.0
Process finished with exit code 0 after commenting statsmodel.
scipy: 0.17.0
numpy: 1.13.1
matplotlib: 1.5.1
Traceback (most recent call last):
File “/home/jeff/pythonPrograms/versions.py”, line 15, in
import statsmodels
ImportError: No module named ‘statsmodels’
pandas: 0.20.3
Process finished with exit code 1
Thanks Jeff, perhaps statsmodels was removed from a recent release of Anaconda?
You can install it via the conda command or via pip.
I think after downloading the statsmodels library, you just have to run the command ‘conda activate base’ from any directory so as to run your versions.py file in your Anaconda environment. And then move to the directory where your versions.py is present and then run that file. This worked for me.
Thanks for sharing!
/usr/bin/python3.5 /home/jeff/PycharmProjects/deepversion_py/deep_versions.py
Traceback (most recent call last):
File “/home/jeff/PycharmProjects/deepversion_py/deep_versions.py”, line 8, in
import keras
ImportError: No module named ‘keras’
Process finished with exit code 1
got this message with each of 3 imports
Perhaps your system has more than one version of Python installed? I have seen this many times with readers on Linux or Mac.
did you solved it? i have the same problem
theano: 1.0.3
tensorflow: 1.11.0
Using TensorFlow backend.
keras: 2.2.4
Well done!
(base) 👽 Machine-Learning-Mastery $ python versions.py
scipy: 1.2.1
numpy: 1.16.2
matplotlib: 3.0.3
pandas: 0.24.2
statsmodels: 0.9.0
sklearn: 0.20.3
(base) 👽 Machine-Learning-Mastery $ python deep_versions.py
theano: 1.0.3
tensorflow: 1.13.1
Using TensorFlow backend.
keras: 2.2.4
Well done!
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
theano: 1.0.3
//anaconda3/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: compiletime version 3.6 of module ‘tensorflow.python.framework.fast_tensor_util’ does not match runtime version 3.7
return f(*args, **kwds)
tensorflow: 1.13.1
Using TensorFlow backend.
keras: 2.2.4
Anything to worry about Jason?
Thanks for initiating my journey btw 🙂 started learning a couple weeks ago and almost gave up if it wasn’t for finding your articles yesterday
Nice work. You can ignore the warning for now perhaps.
done…now i can start working through machine learning mastery with python ebook!
theano: 1.0.4
tensorflow: 2.0.0
Using TensorFlow backend.
keras: 2.3.1
Well done!
Ready to rock and roll!
(base) C:\Users\ld3814>python versions.py
scipy: 1.4.1
numpy: 1.18.1
matplotlib: 3.1.3
pandas: 1.0.1
statsmodels: 0.11.0
sklearn: 0.22.1
(base) C:\Users\ld3814>python deep_versions.py
theano: 1.0.4
tensorflow: 2.1.0
Using TensorFlow backend.
keras: 2.3.1
Well done!
scipy: 1.4.1
numpy: 1.16.4
matplotlib: 3.1.3
pandas: 1.0.3
statsmodels: 0.11.0
sklearn: 0.22.1
Hello dear, do you know why my numpy version is lower than you? I just updatd it.
Well done.
Perhaps try updating it?
I got: scipy: 1.5.0
numpy: 1.19.1
matplotlib: 3.3.1
pandas: 1.1.1
statsmodels: 0.11.1
sklearn: 0.23.2
thanks for keeping this simple
Nice work!
scipy: 1.5.2
numpy: 1.19.2
matplotlib: 3.3.2
pandas: 1.1.3
statsmodels: 0.12.0
sklearn: 0.23.2
Well done!
Command line is not working for Windows user.
Where i can find command for windows?
Thx
It has been more than a decade since I have used Windows.
Maybe it’s called command prompt or terminal?
It’s okay Mr. Jason.
I found it already.
Thx
Glad to hear it Nico.
you can try to use command prompt (cmd.exe) or alternatively use git-bash. it’s a more versatile version of cmd
Have you tried adding the Python path in the environment variables ?
I install the windows version and I cannot install tensorflow pakage. The Python version is 3.6.0 and tensorflow is compatible with Python 3.5 only.
Same
Consider using Keras with Theano, everything will work perfectly.
To use Keras, you only need TensorFlow OR Theano. If you have installed Theano, you can start using Keras.
conda install python=3.5
and it is successfully working on that.
Thanks for the tip Harsha.
I have installed theano and tensorflow, while the errors pop out when installing keras.
C:\Users\stevenwsy>pip install keras
Collecting keras
Using cached Keras-1.2.2.tar.gz
Requirement already satisfied: theano in c:\users\stevenwsy\lib\site-packages (from keras)
Requirement already satisfied: pyyaml in c:\users\stevenwsy\lib\site-packages (from keras)
Requirement already satisfied: six in c:\users\stevenwsy\lib\site-packages (from keras)
Requirement already satisfied: numpy>=1.7.1 in c:\users\stevenwsy\lib\site-packages (from theano->keras)
Requirement already satisfied: scipy>=0.11 in c:\users\stevenwsy\lib\site-packages (from theano->keras)
Exception:
Traceback (most recent call last):
File “C:\Users\stevenwsy\lib\site-packages\pip\basecommand.py”, line 215, in main
status = self.run(options, args)
File “C:\Users\stevenwsy\lib\site-packages\pip\commands\install.py”, line 335, in run
wb.build(autobuilding=True)
File “C:\Users\stevenwsy\lib\site-packages\pip\wheel.py”, line 749, in build
self.requirement_set.prepare_files(self.finder)
File “C:\Users\stevenwsy\lib\site-packages\pip\req\req_set.py”, line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File “C:\Users\stevenwsy\lib\site-packages\pip\req\req_set.py”, line 666, in _prepare_file
check_dist_requires_python(dist)
File “C:\Users\stevenwsy\lib\site-packages\pip\utils\packaging.py”, line 48, in check_dist_requires_python
feed_parser.feed(metadata)
File “C:\Users\stevenwsy\lib\email\feedparser.py”, line 177, in feed
self._input.push(data)
File “C:\Users\stevenwsy\lib\email\feedparser.py”, line 101, in push
parts = data.splitlines(True)
AttributeError: ‘NoneType’ object has no attribute ‘splitlines’
Sorry Steven, I have not seen this error.
try:
conda install –force html5lib
and then
pip install keras
The output looks OK for versions.py, shown as follows
C:\Users\stevenwsy\Desktop\Steven – Python>python versions.py
scipy: 0.18.1
numpy: 1.12.0
matplotlib: 2.0.0
pandas: 0.19.2
statsmodels: 0.8.0
sklearn: 0.18.1
Though the output from deep_versions.py is consistent with those in the post for theano and tensorflow, there is warning for theano installation. Is it the reason for the failure of keras installation?
C:\Users\stevenwsy\Desktop\Steven – Python>python deep_versions.py
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
theano: 0.8.2.dev-901275534cbfe3fbbe290ce85d1abf8bb9a5b203
tensorflow: 1.0.1
Consider trying this tutorial and confirm your Keras environment works correctly:
https://machinelearningmastery.com/tutorial-first-neural-network-python-keras/
Installing additional modules mingw and libpython appear to resolve this issue on Winx64
conda install mingw libpython
ref:
http://stackoverflow.com/questions/40542214/warning-theano-configdefaults-g-not-detected-theano-will-be-unable-to-exe
Thanks for the note and link James.
It would be great if you add xgboost. It complete all necessary things.
Great suggestion Alex! Thanks.
Thanks! providing the installation Guide for Python
I successfully Installed the below Contents
1)Download Anaconda
2)Install Anaconda
3)Start and Update Anaconda
4)Update scikit-learn Library
5)Deep Learning Libraries, .
Well done Thrinadh!
On Win7 x64:
theano: 0.8.2.dev-901275534cbfe3fbbe290ce85d1abf8bb9a5b203
tensorflow: 1.0.0-rc2
keras: 2.0.0
resolved warnings with tensorflow by installing nightly build
resolved warnings with theano by installing mingw and libpython packages
Very nice work!
Please do I need internet connection to set up virtual environment?
I don’t have tutorials on setting up a virtual environment. Perhaps post your question to stackoverflow.
How to install tensorflow on windows??
getting following error after installing tensorflow version 1.0.0
C:\Users\324034784>pip install keras
Collecting keras
Using cached Keras-2.0.0.tar.gz
Collecting tensorflow (from keras)
Could not find a version that satisfies the requirement tensorflow (from keras) (from versions: )
No matching distribution found for tensorflow (from keras)
Is this due to tensorflow version?
Consider installing Keras 1.2.2 instead that will work with tensorflow 1.0.
Keras 2.0 requires tensorflow 1.0.1+
For example:
Hi, Jason, I have successfully installed theano and keras, but when I ran my code in spyder, I met with the problem ” the kernel died and restarting” repeatedly, I’d appreciate it if you can help me with this.
Perhaps try running from the command line. Editors and notebooks often cause or hide errors.
theano: 0.8.2.dev-901275534cbfe3fbbe290ce85d1abf8bb9a5b203
tensorflow: 1.0.0
Using TensorFlow backend.
keras: 2.0.0
Very nice victor!
C:\Python27\Scripts>python deep_versions.py
Traceback (most recent call last):
File “deep_versions.py”, line 2, in
import theano
ImportError: No module named theano
C:\Python27\Scripts>import theano
‘import’ is not recognized as an internal or external command,
operable program or batch file.
C:\Python27\Scripts>python deep_versions.py
Traceback (most recent call last):
File “deep_versions.py”, line 2, in
import theano
ImportError: No module named theano
Looks like you do not have Theano installed.
C:\Python27\Scripts>conda create -n my_root –clone=C:\ProgramData\Anaconda2
Source: C:\ProgramData\Anaconda2
Destination: C:\Users\HP\AppData\Local\conda\conda\envs\my_root
The following packages cannot be cloned out of the root environment:
– conda-4.3.14-py27_1
– conda-env-2.6.0-0
Packages: 178
Files: 1830
#
# To activate this environment, use:
# > activate my_root
#
# To deactivate this environment, use:
# > deactivate my_root
#
# * for power-users using bash, you must source
#
C:\Python27\Scripts>
C:\Python27\Scripts>activate my_root
(my_root) C:\Python27\Scripts>deep_versions.py
Traceback (most recent call last):
File “C:\Python27\Scripts\deep_versions.py”, line 2, in
import theano
ImportError: No module named theano
It looks like you do not have Theano installed.
C:\>python
Python 2.7.13 |Anaconda 4.3.1 (32-bit)| (default, Dec 19 2016, 13:36:02) [MSC v.
1500 32 bit (Intel)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import theano
WARNING (theano.configdefaults): g++ not available, if using conda:
conda insta
ll m2w64-toolchain
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to exe
cute optimized C-implementations (for both CPU and GPU) and will default to Pyth
on implementations. Performance will be severely degraded. To remove this warnin
g, set Theano flags cxx to an empty string.
Nice, you might be able to ignore the warnings for now.
Thank you
(py35) C:\Python27\Scripts>python deep_versions.py
Traceback (most recent call last):
File “deep_versions.py”, line 2, in
import theano
ImportError: No module named ‘theano’
Actually i am trying on windows 7 its always giving some problems while installing Theano & Tensorflow, Please suggest me what will be the best solution. Thank You
scipy: 0.18.1
numpy: 1.11.3
matplotlib: 2.0.0
pandas: 0.19.2
statsmodels: 0.6.1
sklearn: 0.18.1
Very nice!
I could not install theano as it is showing the following error.
UnsatisfiableError: The following specifications were found to be in conflict:
-python 3.6*
-theano -> python 2.7*
Hi Yash, sorry to hear that. Consider installing the Python 2.7 version of Anaconda instead, or find an alternate way to install Theano on your system.
Hello,
I wrote a very similar article on how to install Keras and Tensorflow (CUDA and CPU) on Windows over a month ago. It also uses the Anaconda environment. It will work with Python 3.5 and I also just updated it to support Keras 2.0 as well. I use it nearly everyday for my own work, so I can confirm that it works.
If anybody is interested, here is the link: http://discover-fx.com/set-up-your-own-keras-with-tensorflow-gpu-deep-learning-environment-on-windows-8-1-and-10/.
Hope it helps somebody out there!
Clark
Maybe Jason could include it under the Further Reading section?
Thanks Clark.
C:\python>python versions.py
scipy: 0.18.1
numpy: 1.11.3
matplotlib: 2.0.0
pandas: 0.19.2
statsmodels: 0.6.1
sklearn: 0.18.1
C:\python>
Very nice Jefferson!
In my 64 bit Windows and 3.6 Python anaconda(64bit) I am unable to install tensorflow
In links suggested by you they say tensorflow on Windows is only supported for 3.5.x python or less
I tried all the commands I could browse on the internet
What should I do next?
Hi Ram, to use Kease you only need Theano OR TensorFlow. If you can install Theano, then you can use Keras.
scipy: 0.18.1
numpy: 1.11.3
matplotlib: 2.0.0
pandas: 0.19.2
statsmodels: 0.6.1
sklearn: 0.18.1
Very nice Richard!
python ./deep_versions.py
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.0.0
Using TensorFlow backend.
keras: 2.0.2
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.0.0
keras: 2.0.2
Very nice Richard!
For those who are stuck at installing Tensorflow because of the Python version (I’m on Anaconda 4.3.1 with python 3.6)
You can create conda environment before installing theano
C:> conda create -n tensorflow python=3.5
C:> activate tensorflow
Keras use tensorflow by default, but I encounter error everytime I tried to install keras before theano
Thanks for the advice Reinhard.
Your comment saved my life. Thank you.
My environment is now configured <3:
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.0.0
Using TensorFlow backend.
keras: 2.0.4
Nice Laura!
tensorflow:xtensor installed on windows 7 , is it ok
Great work!
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 0.11.0
Using TensorFlow backend.
keras: 2.0.3
Well done John!
C:\Users\\Documents\Python Scripts\_ML>python deep_versions.py
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
Using TensorFlow backend.
keras: 2.0.3
I used a Tensorflow wheel build for python3.6 from:
# http://www.lfd.uci.edu/~gohlke/pythonlibs/#tensorflow
# tensorflow‑1.0.1‑cp36‑cp36m‑win_amd64.whl
I’ll report if this works for me or if I need to go to a 3.5 environment.
Nice work!
Hi Jason,
I had an issue with installing Tensorflow in Win7 PC. During install it stated that Python 3.6 and Tensorflow 3.5 are incompatible.
I then uninstalled everything and started fresh and left out Tensorflow. Not sure if that’s going to be an issue (your note indicated that only either keras or tensorflow are needed).
C:\Temp>python versions.py
scipy: 0.18.1
numpy: 1.11.3
matplotlib: 2.0.0
pandas: 0.19.2
statsmodels: 0.6.1
sklearn: 0.18.1
C:\Temp>python deep_versions.py
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
Traceback (most recent call last):
File “deep_versions.py”, line 5, in
import tensorflow
ModuleNotFoundError: No module named ‘tensorflow’
In the ‘deep_versions.py’ script I swappped the order of the ‘keras’ and ‘tensorflow’ check.
C:\Temp>python deep_versions.py
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
Using TensorFlow backend.
Traceback (most recent call last):
File “deep_versions.py”, line 5, in
import keras
File “C:\ProgramData\Anaconda3\lib\site-packages\keras\__init__.py”, line 3, i
n
from . import activations
File “C:\ProgramData\Anaconda3\lib\site-packages\keras\activations.py”, line 3
, in
from . import backend as K
File “C:\ProgramData\Anaconda3\lib\site-packages\keras\backend\__init__.py”, l
ine 73, in
from .tensorflow_backend import *
File “C:\ProgramData\Anaconda3\lib\site-packages\keras\backend\tensorflow_back
end.py”, line 1, in
import tensorflow as tf
ModuleNotFoundError: No module named ‘tensorflow’
You only need Theano OR TensorFlow for deep learning with Keras, not both.
You can comment out the line that checks the TensorFlow version.
You can update Keras to use Theano by editing the config file, see here:
https://machinelearningmastery.com/introduction-python-deep-learning-library-keras/
I as able to get through your tutorial without issues even though I could not install Tensorflow
Great work PJ!
Hi Jason,
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.1.0-rc2
Using TensorFlow backend.
keras: 2.0.3
TensorFlow wasn’t easy, got to google the many errors I saw.
i’m using Intel i5-6300 @2.4GHz and I see the deep_versions.py takes at least 5 seconds to load.. is it ok?
Thanks,
Eid
Well done!
Yes, that is normal as it has to load a lot of libs into memory. Specifically Theano can be very slow to start. The second time it is run should be much faster.
Whenever I type the command python deep.py (for point 5), it says
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
Traceback (most recent call last):
File “deep.py”, line 5, in
import tensorflow
ModuleNotFoundError: No module named ‘tensorflow’
Pls help me and reply fast!
You don’t need tensorflow and theano. Just comment out the import and check of tensorflow.
Here is mine
scipy: 0.18.1
numpy: 1.11.3
matplotlib: 2.0.0
pandas: 0.19.2
statsmodels: 0.6.1
sklearn: 0.18.1
Great work Trang!
hi sir,
I am getting this in my cmd.
C:\ProgramData\Anaconda3>python deep.py
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
Traceback (most recent call last):
File “deep.py”, line 5, in
import tensorflow
ModuleNotFoundError: No module named ‘tensorflow’
Could you please help me letting know what to do?
Comment out that line if you do not have TF installed.
What does that mean sir?
Comment out the line that imports tensorflow and that prints the tensorflow version if you do not have tensorflow installed.
MacBook-Pro:AnacondaWorkspace shai$ python versioncheck.py
scipy: 0.18.1
numpy: 1.11.3
matplotlib: 2.0.0
pandas: 0.19.2
statsmodels: 0.6.1
sklearn: 0.18.1
theano: 0.9.0
tensorflow: 1.0.0
Using TensorFlow backend.
keras: 2.0.4
MacBook-Pro:AnacondaWorkspace shai$
Well done Shai.
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.0.0
Using TensorFlow backend.
keras: 2.0.4
Great work Ibrahim!
scipy: 0.18.1
numpy: 1.11.3
matplotlib: 2.0.0
pandas: 0.19.2
statsmodels: 0.6.1
sklearn: 0.18.1
Great work!
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.0.0
Using TensorFlow backend.
keras: 2.0.4
Nice!
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.1.0
Using TensorFlow backend.
keras: 2.0.4
Very nice Paul.
I eventually used the last Anaconda3 version I found with python 3.5
https://repo.continuum.io/archive/index.html
Anaconda3-4.2.0-Windows-x86_64.exe
After that install I followed the steps and got
python deep_versions.py
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.0.0
Using TensorFlow backend.
keras: 2.0.4
python versions.py
scipy: 0.18.1
numpy: 1.11.3
matplotlib: 2.0.0
pandas: 0.19.2
statsmodels: 0.6.1
sklearn: 0.18.1
thanks for the info!
Very nice!
scipy: 0.18.1
numpy: 1.11.3
matplotlib: 2.0.0
pandas: 0.19.2
statsmodels: 0.6.1
sklearn: 0.18.1
Very nice rodrigo!
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.0.0
Using TensorFlow backend.
keras: 2.0.4
Very nice Vinay!
why install keras using pip rather than conda ?
I found it easier.
Were you able to easily install Keras using conda?
scipy: 0.18.1
numpy: 1.11.3
matplot lib : 2.0.0
pandas: 0.19.2
statsmodels: 0.6.1
sklearn : 0.18.1
Very nice Asif!
def load doc_(“Filename”):
sir i don’t understand which file name i use?
Python 3.6.0 :: Anaconda 4.3.1 (64-bit)
scipy: 0.18.1
numpy: 1.11.3
matplotlib: 2.0.0
pandas: 0.19.2
statsmodels: 0.6.1
sklearn: 0.18.1
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
Using Theano backend.
keras: 2.0.4
I found this useful to locate keras.json on Windows:
https://stackoverflow.com/questions/40310035/how-to-change-keras-backend-wheres-the-json-file
Very nice Tomasz!
Thanks for the link for windows users (an area I know very little about).
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 0.12.0-rc0
Using TensorFlow backend.
keras: 2.0.4
Very nice!
Congratulations, this is an excellent post.
My results for versions.py was:
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.18.1
Thank you.
Thanks! Nice work Juan.
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.1.0
Using TensorFlow backend.
keras: 2.0.4
Very nice work Mahdis!
CondaIOError: Missing write permissions in: /home/saswati/anaconda2
#
# You don’t appear to have the necessary permissions to install packages
# into the install area ‘/home/saswati/anaconda2’.
# However you can clone this environment into your home directory and
# then make changes to it.
# This may be done using the command:
#
# $ conda create -n my_root –clone=”/home/saswati/anaconda2″
Sorry, I have not seen this error before. Perhaps post to Anaconda support or stackoverflow?
I got:
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.2.0-rc2
Using TensorFlow backend.
keras: 2.0.4
thanks so much!!!!
Very nice Maria!
Thank You!!!
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.1.0
Using TensorFlow backend.
keras: 2.0.2
Very nice Saswati!
theano: 0.9.0
tensorflow: 1.2.0-rc2
Using TensorFlow backend.
keras: 2.0.4
Thanks Jason!
Very nice Ankit!
Hello, I got this error when trying to use anaconda. I believe it was installed into the incorrect directory as it was installed by default into the Macintosh HD instead of the python folder.
Traceback (most recent call last):
File “/Users/USERNAME/Documents/machine learning/versions.py”, line 2, in
import scipy
ModuleNotFoundError: No module named ‘scipy’
>>>
I’m sorry to hear that.
Perhaps you need to re-open your terminal after anaconda was installed?
Hi Jason,
I am trying this program out for the first time. I love your documentation!. My program is very slow. I have followed your instructions to install Kera, tensarflow …
I get this warning
2017-06-16 14:35:01.271282: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn’t compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-06-16 14:35:01.271304: 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.
2017-06-16 14:35:01.271308: 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.
2017-06-16 14:35:01.271314: 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.
2017-06-16 14:35:01.271317: 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.
You can ignore those warnings for now unless you want to dive into compiling tensorflow from scratch on your system (not recommended).
I would create a python 3.5 (anaconda3) program executable, please how to do it?
Sorry, I cannot help you with this.
python deep_versions.py
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.1.0
Using TensorFlow backend.
keras: 2.0.5
Nice work daveg!
Hi I’m getting the following:
python deep_version.py
Could not find platform independent libraries
Could not find platform dependent libraries
Consider setting $PYTHONHOME to [:]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named ‘encodings’
Current thread 0x00007f60ac325700 (most recent call first):
Aborted (core dumped)
Do you know what is causing this? I’ve read multiple python installs but I have 2.7.12 and 3.6.2 and don’t think these two should conflict…thanks!
Sorry, I have not seen this error, consider posting to stackoverflow or contacting anaconda support?
hii Jason !!
I have a Windows system and python 2.7 , I installed theano and Keras ,
and I tried to print the deep_versions.py , I edited the code and removed the lines for Tensor flow, I am getting this error
===============================
Problem occurred during compilation with the command line below:
“C:\Users\Seema Singh\Anaconda2\Library\mingw-w64\bin\g++.exe” -shared -g -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -DMS_WIN64 -I”C:\Users\Seema Singh\Anaconda2\lib\site-packages\numpy\core\include” -I”C:\Users\Seema Singh\Anaconda2\include” -I”C:\Users\Seema Singh\Anaconda2\lib\site-packages\theano\gof” -L”C:\Users\Seema Singh\Anaconda2\libs” -L”C:\Users\Seema Singh\Anaconda2″ -o C:\Users\Seema Singh\AppData\Local\Theano\compiledir_Windows-10-10.0.10240-Intel64_Family_6_Model_58_Stepping_9_GenuineIntel-2.7.13-64\lazylinker_ext\lazylinker_ext.pyd C:\Users\Seema Singh\AppData\Local\Theano\compiledir_Windows-10-10.0.10240-Intel64_Family_6_Model_58_Stepping_9_GenuineIntel-2.7.13-64\lazylinker_ext\mod.cpp -lpython27
g++.exe: error: Singh\AppData\Local\Theano\compiledir_Windows-10-10.0.10240-Intel64_Family_6_Model_58_Stepping_9_GenuineIntel-2.7.13-64\lazylinker_ext\lazylinker_ext.pyd: No such file or directory
g++.exe: error: C:\Users\Seema: No such file or directory
g++.exe: error: Singh\AppData\Local\Theano\compiledir_Windows-10-10.0.10240-Intel64_Family_6_Model_58_Stepping_9_GenuineIntel-2.7.13-64\lazylinker_ext\mod.cpp: No such file or directory
Traceback (most recent call last):
File “deep_versions.py”, line 2, in
import theano
File “C:\Users\Seema Singh\Anaconda2\lib\site-packages\theano\__init__.py”, line 66, in
from theano.compile import (
File “C:\Users\Seema Singh\Anaconda2\lib\site-packages\theano\compile\__init__.py”, line 10, in
from theano.compile.function_module import *
File “C:\Users\Seema Singh\Anaconda2\lib\site-packages\theano\compile\function_module.py”, line 21, in
import theano.compile.mode
File “C:\Users\Seema Singh\Anaconda2\lib\site-packages\theano\compile\mode.py”, line 10, in
import theano.gof.vm
File “C:\Users\Seema Singh\Anaconda2\lib\site-packages\theano\gof\vm.py”, line 662, in
from . import lazylinker_c
File “C:\Users\Seema Singh\Anaconda2\lib\site-packages\theano\gof\lazylinker_c.py”, line 127, in
preargs=args)
File “C:\Users\Seema Singh\Anaconda2\lib\site-packages\theano\gof\cmodule.py”, line 2316, in compile_str
(status, compile_stderr.replace(‘\n’, ‘. ‘)))
Exception: Compilation failed (return status=1): g++.exe: error: Singh\AppData\Local\Theano\compiledir_Windows-10-10.0.10240-Intel64_Family_6_Model_58_Stepping_9_GenuineIntel-2.7.13-64\lazylinker_ext\lazylinker_ext.pyd: No such file or dire. g++.exe: error: Singh\AppData\Local\Theano\compiledir_Windows-10-10.0.10240-Intel64_Family_6_Model_58_Stepping_9_Genui. Intel-2.7.13-64\lazylinker_ext\mod.cpp: No such file or directory
That does not look, sorry to hear that.
Perhaps try posting to the theano user group or stack overflow?
hii Jason!
I have successfully installed theano but
It seems like Keras has no been installed in my system
theano 0.9.0 py27_0
(C:\Users\Seema Singh\Anaconda2) C:\Users\Seema Singh>pip install keras
Requirement already satisfied: keras in c:\users\seema singh\anaconda2\lib\site-packages
Requirement already satisfied: pyyaml in c:\users\seema singh\anaconda2\lib\site-packages (from keras)
Requirement already satisfied: theano in c:\users\seema singh\anaconda2\lib\site-packages (from keras)
Requirement already satisfied: six in c:\users\seema singh\anaconda2\lib\site-packages (from keras)
Requirement already satisfied: numpy>=1.9.1 in c:\users\seema singh\anaconda2\lib\site-packages (from theano->keras)
Requirement already satisfied: scipy>=0.14 in c:\users\seema singh\anaconda2\lib\site-packages (from theano->keras)
That is odd.
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.18.1
WARNING (theano.configdefaults): Only clang++ is supported. With g++, we end up with strange g++/OSX bugs.
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.1.0
Using TensorFlow backend.
keras: 2.0.5
Great work Tushar!
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.18.1
Very nice Candida.
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.18.1
Very nice!
scipy:0.19.0
numpy:1.12.1
pandas:0.20.1
matplotlib:2.0.2
statsmodels:0.8.0
sklearn:0.18.1
theano:0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow:1.1.0
Using TensorFlow backend.
keras:2.0.5
Well done Sana!
Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\Users\FOLASADE ARIYIKE>conda -V
conda 4.3.22
C:\Users\FOLASADE ARIYIKE>python -V
Python 3.6.1 :: Anaconda 4.4.0 (64-bit)
C:\Users\FOLASADE ARIYIKE>conda update anaconda
Fetching package metadata …
CondaHTTPError: HTTP None None for url
Elapsed: None
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
ConnectTimeout(MaxRetryError(“HTTPSConnectionPool(host=’repo.continuum.io’, port=443): Max retries exceeded with url: /pkgs/free/win-64/repodata.json.bz2 (Caused by ConnectTimeoutError(, ‘Connection to repo.continuum.io timed out. (connect timeout=9.15)’))”,),)
C:\Users\FOLASADE ARIYIKE>conda update anaconda
Fetching package metadata ………..
Solving package specifications: .
# All requested packages already installed.
# packages in environment at C:\Users\FOLASADE ARIYIKE\Anaconda3:
#
anaconda 4.4.0 np112py36_0
C:\Users\FOLASADE ARIYIKE>
Consider checking your internet connection.
Hi, Jason
Congratulations and thanks for your excellent pages!
My environment is like this:
scipy: 0.19.0
numpy: 1.13.0
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.18.1
and tensorflow 1.2.1 – as far as I understand it includes keras as tensorflow.keras – but I shall soon find out how things stand when I begin development 🙂
Well done.
Thanks. Nice tutorial..
Thanks Tom.
Thanks! This helped me SOOO much. 🙂
I’m glad to hear that.
Finally got it after 5 hours of effort on tensorflow cpu, no module found tensorflow was the error in an anaconda command prompt, I ran “python -m pip install tensorflow” which fixed the issue in Windows 10. Also, had setup the tensorflow with python 3.5, trying to switch keras backend and configs to theanos was unsuccessful for me as well.
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.18.2
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.2.1
Using TensorFlow backend.
keras: 2.0.6
Glad to hear you got there Joel!
>>> matplotlib: 2.0.2
>>> numpy: 1.12.1
>>> pandas: 0.20.1
>>> scipy: 0.19.0
>>> sklearn: 0.18.1
>>> statsmodels: 0.8.0
$ python deep_versions.py
Using TensorFlow backend.
keras: 2.0.6
matplotlib: 2.0.2
numpy: 1.12.1
pandas: 0.20.1
scipy: 0.19.0
sklearn: 0.18.2
statsmodels: 0.8.0
tensorflow: 1.1.0
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
Very nice!
Thanks for you page.
On my MacBook I get issues with the installation of Tensorflow:
Any idea?
Thanks
WARNING (theano.configdefaults): Only clang++ is supported. With g++, we end up with strange g++/OSX bugs.
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
Traceback (most recent call last):
File “deep_versions.py”, line 4, in
import tensorflow
ModuleNotFoundError: No module named ‘tensorflow’
See this tutorial for installation on OS X (that I use):
https://machinelearningmastery.com/install-python-3-environment-mac-os-x-machine-learning-deep-learning/
Soory I gort a step. et me retry 😉
Same problem. Sorry
WARNING (theano.configdefaults): Only clang++ is supported. With g++, we end up with strange g++/OSX bugs.
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
Traceback (most recent call last):
File “deep_versions.py”, line 4, in
import tensorflow
ModuleNotFoundError: No module named ‘tensorflow’
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.1.0
Using TensorFlow backend.
keras: 2.0.6
Very nice Matty!
Hi,
Here is my output
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.18.1
Very nice Allegra.
Hello there,
First I want to thank you for all that you’re doing for us newbies and second here is my output 🙂 :
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.18.2
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.1.0
Using TensorFlow backend.
keras: 2.0.6
Very nice Gentiana, well done!
Traceback (most recent call last):
File “deep_versions.py”, line 2, in
import theano
File “C:\Users\extreme gamer\Anaconda3\lib\site-packages\theano\__init__.py”, line 66, in
from theano.compile import (
File “C:\Users\extreme gamer\Anaconda3\lib\site-packages\theano\compile\__init__.py”, line 10, in
from theano.compile.function_module import *
File “C:\Users\extreme gamer\Anaconda3\lib\site-packages\theano\compile\function_module.py”, line 21, in
import theano.compile.mode
File “C:\Users\extreme gamer\Anaconda3\lib\site-packages\theano\compile\mode.py”, line 10, in
import theano.gof.vm
File “C:\Users\extreme gamer\Anaconda3\lib\site-packages\theano\gof\vm.py”, line 662, in
from . import lazylinker_c
File “C:\Users\extreme gamer\Anaconda3\lib\site-packages\theano\gof\lazylinker_c.py”, line 127, in
preargs=args)
File “C:\Users\extreme gamer\Anaconda3\lib\site-packages\theano\gof\cmodule.py”, line 2316, in compile_str
(status, compile_stderr.replace(‘\n’, ‘. ‘)))
Exception: Compilation failed (return status=1): g++.exe: error: gamer\AppData\Local\Theano\compiledir_Windows-10-10.0.14393-SP0-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.6.1-64\lazylinker_ext\lazylinker_ext.pyd: No such file or d. g++.exe: error: gamer\AppData\Local\Theano\compiledir_Windows-10-10.0.14393-SP0-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.6.1-64\lazylinker_ext\mod.. p: No such file or directory
Sorry to see that you are having an error. Perhaps post your question to stackoverflow?
Hi
More from me:
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.1.0
Using TensorFlow backend.
keras: 2.0.6
Well done Allegra!
Had trouble configuring Tensorflow on a Windows and Python 2.7 environment. Seems like you need at least Python 3.5 for Tensorflow on Windows.
Switching the Keras Backend to Theano, however, worked fine for me. You need to alter a JSON-Init file to ‘theano’ and that’s it. The Keras.io Project Site has a nice page about switching backends with easy-to-follow instructions.
Additional hint I learnt there:
print(‘keras Backend: %s’ % keras.backend.backend())
returns the Backend currently in use.
Great tips, thanks for sharing Athenagoras!
Good instructions and worked smmothly for me. Thanks.
Thanks Alfred, I’m glad to hear that!
If you install Anaconda 4.4.0 which by default bundles with Python 3.6, you HAVE TO downgrade Python to v3.5 before install tensorflow. Here is what I got 🙂
scipy: 0.19.1
numpy: 1.13.1
matplotlib: 2.0.2
pandas: 0.20.2
statsmodels: 0.8.0
sklearn: 0.18.2
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.2.0
keras: 2.0.6
keras Backend: tensorflow
Thanks for sharing Shuan. Nice work too by the way!
I got:
conda 4.3.22
Python 3.5.3 :: Anaconda 4.4.0 (32-bit)
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.18.2
HOWEVER, I FAIL at installing tensorflow. Please HELP.
I created a conda ‘tensorflow’ environment with python 3.5. With command
『pip install –ignore-installed –upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.2.1-cp35-cp35m-win_amd64.whl』
I got ERROR saying
『tensorflow-1.2.1-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform』
So i changed to version 1.0.1 and same error.
Version 1.1.0 also same error.
So i deactivated the environment, and type command『conda install -c conda-forge tensorflow』
I got ERROR『PackageNotFoundError: Package missing in current win-32 channels』 Instead it says the close match found is “xtensor” which i don’t know what is it.
Is it because I’m using a 32-bit Windows 10?
So I also tried running the following :
『python -m pip install –upgrade tensorflow』
and got ERROR of『Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow』
What more requirements do i need for this?
I tried 『pip3 install tensorflow』 but somehow it could not recognized ‘pip3’. So i type 『where pip3』 and it could not find files for the given pattern. So i type『where python』. It ouput the directory of my python. Then checked if it’s already put under the path inside the environmental variable. And it has.
I’ve been stuck for dayssss and actually postponed my projects for months because of this. Please help it means a LOT o(╯□╰)o
Sorry, I don’t know a thing about windows. I would recommend posting to stack overflow.
Hello Amira – As I mentioned in previous post, you HAVE TO either upgrade python to 3.5 or create py35 environment. I didn’t try to create py35 environment instead I downgraded python 3.6 to python 3.5 by simply typing “conda install python=3.5” right after Aanconda 4.4 installed. Then you just follow the procedure Jason provided. it worked perfectly. Good luck.
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.18.2
************************
deep_versions
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f129
tensorflow: 1.2.1
Using TensorFlow backend.
keras: 2.0.6
Well done!
Thank you Mr. Jason for sharing such a useful resource.
I just wanted to know if there is any way i can install Tensorflow GPU,because my machine has AMD (Radeon) and want to perform computation on my GPU instead of CPU.I have studied the documentation for Tensorflow which supports Nvidia Cuda only.
There may be, I don’t know.
You could use AWS instead:
https://machinelearningmastery.com/develop-evaluate-large-deep-learning-models-keras-amazon-web-services/
Mac_mechanics python “D:\Deep Learning Folder\Initialization\versions.py”
scipy:0.19.0
numpy:1.12.1
matplotlib:2.0.2
pandas:0.20.1
statsmodels:0.8.0
sklearn:0.18.1
I needed to hardcode the directory since I cannot change the directory using prompt command
Nice work Mac!
Awesome stuff Jason
Thanks, I hope it helped.
I installed successfully. Thanks!
PS D:\anaconda> python versions.py
scipy: 0.19.1
numpy: 1.13.1
matplotlib: 2.0.2
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.18.2
PS D:\anaconda> python deep_versions.py
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.2.1
Using TensorFlow backend.
keras: 2.0.6
PS D:\anaconda>
Very nice Nelson!
tensorflow: 1.2.0
Using TensorFlow backend.
keras: 2.0.6
TANKS VERY MUCH!
Great work!
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.18.1
tensorflow: 1.3.0-rc1
This was a HUGE pain to get through and I’m still not 100% sure I did it right, but I’m very much looking forward to writing some actual script. I GREATLY appreciate your direction on this!
Nice work Dave!
What was the painful part?
>>> import theano
>>> print(‘theano: %s’ % theano.__version__)
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
>>> import tensorflow
>>> print(‘tensorflow: %s’ % tensorflow.__version__)
tensorflow: 1.2.0
>>> import keras
Using TensorFlow backend.
print(‘keras: %s’>>> print(‘keras: %s’ % keras.__version__)
keras: 2.0.6
>>>
Well done Chenin!
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.2.1
Using TensorFlow backend.
keras: 2.0.6
Nice work!
hi i have install everything that you have told but i don’t know how to run anaconda . i use ubuntu 16.4 lts . i need to know which command to run on the terminal to start the anaconda
Open the command line and type:
This will open the python interpreter.
i have installed everything but i don’t know how to start/run anaconda in ubuntu. i want to know the command to run anaconda in ubuntu via terminal
Great tutorial, thanks!!!
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.18.1
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.2.1
Using TensorFlow backend.
keras: 2.0.6
Nice work Jonas!
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.18.1
Nice work Nuibb!
Without using a C++ compiler my setup (see below) works well (but slow of course). I used the code example of your book “Deep Learning with Python\Develop your first neural network with Keras (page 47, capter 7.8)”.
To speed up the runtime I installed TDM-GCC. Then an import error “DLL load failed” was shown – even after installing OpenBLAS.
I know that I didn’t follow exactly your installation guide on this site but it seems to me there’s only a penny to success. Maybe you/someone else had the same problem and knows a solution?
Installed software:
– Windows 10 Home
– Python 3.6.1 (v3.6.1:69c0db5) [MSC v.1900 64 bit (AMD64)] on win32
– numpy (1.13.0rc2+mkl) (installed as wheel)
– scipy (0.19.0) (installed as wheel)
– scikit-learn (0.18.1) (installed as wheel)
– Theano (0.9.0)
– Keras (2.0.6)
– gcc version 5.1.0 (tdm64-1)
– OpenBLAS-v0.2.19-Win64-int32
I added the following entries to the path:
C:\Python36\
C:\TDM-GCC-64\bin\
C:\TDM-GCC-64\x86_64-w64-mingw32\bin\
C:\TDM-GCC-64\x86_64-w64-mingw32\lib\
C:\OpenBLAS-v0.2.19-Win64-int32\bin\
C:\OpenBLAS-v0.2.19-Win64-int32\lib\
My theaonrc.txt looks like this:
[global]
floatX = float32
device = cpu
cxx=C:\\TDM-GCC-64\\bin\\g++.exe
[blas]
ldflags = -LC:\\OpenBLAS-v0.2.19-Win64-int32\\bin -LC:\\OpenBLAS-v0.2.19- Win64-int32\\lib -lopenblas
Trace log which shows the error:
Using Theano backend.
Traceback (most recent call last):
File “C:/Christian/Python/DL.py”, line 15, in model.add(Dense(12, input_dim=8, activation=’relu’))
File “C:\Python36\lib\site-packages\keras\models.py”, line 436, in add layer(x)
File “C:\Python36\lib\site-packages\keras\engine\topology.py”, line 569, in __call__self.build(input_shapes[0])
File “C:\Python36\lib\site-packages\keras\layers\core.py”, line 825, in build constraint=self.kernel_constraint)
File “C:\Python36\lib\site-packages\keras\legacy\interfaces.py”, line 87, in wrapper return func(*args, **kwargs)
File “C:\Python36\lib\site-packages\keras\engine\topology.py”, line 391, in add_weight weight = K.variable(initializer(shape), dtype=dtype, name=name)
File “C:\Python36\lib\site-packages\keras\initializers.py”, line 208, in __call__dtype=dtype, seed=self.seed)
File “C:\Python36\lib\site-packages\keras\backend\theano_backend.py”, line 2191, in random_uniform return rng.uniform(shape, low=minval, high=maxval, dtype=dtype)
File “C:\Python36\lib\site-packages\theano\sandbox\rng_mrg.py”, line 1354, in uniform rstates = self.get_substream_rstates(nstreams, dtype)
File “C:\Python36\lib\site-packages\theano\configparser.py”, line 117, in res return f(*args, **kwargs)
File “C:\Python36\lib\site-packages\theano\sandbox\rng_mrg.py”, line 1256, in get_substream_rstates multMatVect(rval[0], A1p72, M1, A2p72, M2)
File “C:\Python36\lib\site-packages\theano\sandbox\rng_mrg.py”, line 66, in multMatVect[A_sym, s_sym, m_sym, A2_sym, s2_sym, m2_sym], o, profile=False)
File “C:\Python36\lib\site-packages\theano\compile\function.py”, line 326, in function output_keys=output_keys)
File “C:\Python36\lib\site-packages\theano\compile\pfunc.py”, line 486, in pfunc output_keys=output_keys)
File “C:\Python36\lib\site-packages\theano\compile\function_module.py”, line 1795, in orig_function defaults)
File “C:\Python36\lib\site-packages\theano\compile\function_module.py”, line 1661, in create input_storage=input_storage_lists, storage_map=storage_map)
File “C:\Python36\lib\site-packages\theano\gof\link.py”, line 699, in make_thunk storage_map=storage_map)[:3]
File “C:\Python36\lib\site-packages\theano\gof\vm.py”, line 1047, in make_all impl=impl))
File “C:\Python36\lib\site-packages\theano\gof\op.py”, line 935, in make_thunk no_recycling)
File “C:\Python36\lib\site-packages\theano\gof\op.py”, line 839, in make_c_thunk output_storage=node_output_storage)
File “C:\Python36\lib\site-packages\theano\gof\cc.py”, line 1190, in make_thunk keep_lock=keep_lock)
File “C:\Python36\lib\site-packages\theano\gof\cc.py”, line 1131, in __compile__keep_lock=keep_lock)
File “C:\Python36\lib\site-packages\theano\gof\cc.py”, line 1586, in cthunk_factory key=key, lnk=self, keep_lock=keep_lock)
File “C:\Python36\lib\site-packages\theano\gof\cmodule.py”, line 1159, in module_from_key module = lnk.compile_cmodule(location)
File “C:\Python36\lib\site-packages\theano\gof\cc.py”, line 1489, in compile_cmodule preargs=preargs)
File “C:\Python36\lib\site-packages\theano\gof\cmodule.py”, line 2325, in compile_str return dlimport(lib_filename)
File “C:\Python36\lib\site-packages\theano\gof\cmodule.py”, line 302, in dlimport rval = __import__(module_name, {}, {}, [module_name])
ImportError: DLL load failed: Eine DLL-Initialisierungsroutine ist fehlgeschlagen.
Sorry, I don’t have any good ideas.
Consider posting to stack overflow?
Thank you anyway.
I posted my question to stack overflow before asking here (but didn’t get any answer so far).
Sorry Chriss, I am not an expert at debugging workstations.
Perhaps it might be worth contacting the Anaconda people?
I gave up, uninstalled my setup and installed Anaconda – now it works 🙂
scipy: 0.19.1
numpy: 1.13.1
matplotlib: 2.0.2
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.18.2
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
keras: 2.0.6
Nice work Chris!
Fabulously simple and cool, just as the rest of this site.
Please note that Keras is now available with CNTK backend as well.
https://docs.microsoft.com/en-us/cognitive-toolkit/Using-CNTK-with-Keras
A good option for Windows users here.
Thanks Shay.
Nice tutorial, I install on windows using Anaconda.
printed out using the notebook and results were:
import keras
print(‘keras: %s’ % keras.__version__)
WARNING (theano.configdefaults): g++ not available, if using conda:
conda install m2w64-toolchain
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
theano: 0.9.0
import tensorflow
print(‘tensorflow: %s’ % tensorflow.__version__)
tensorflow: 1.2.1
import keras
print(‘keras: %s’ % keras.__version__)
Using TensorFlow backend.
keras: 2.0.6
How critical is the warning for theano as my GPU is an AMD Radeon(not NVDIA)
Nice!
You can ignore the warnings for now.
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.2.1
Using Theano backend.
keras: 2.0.2
Well done Dawit!
hi profecer I have installed anaconda with the appropriate libreries but my backend is theano but when am writing a sample code of python it displays an error message
Traceback (most recent call last):
File “C:/Users/dave/PycharmProjects/AccuracyPlot/AccuracyLossPlot.py”, line 2, in
from keras.models import Sequential
ImportError: No module named keras.models
so what can I do Sir? I need your help
Try running code from the command line, perhaps your IDE or notebook is causing faults (they often do!)
Thanks a lot Jason for this very useful article. I am a windows user and I had installed theano tensorflow and keras incorrectly which corrupted my numpy as well. Consequently, I had to reinstall anaconda and using this article I was able to set up the required packages perfectly.
As you correctly pointed out, Keras can now be run using either theano or tensorflow ( and window users may want to avoid tensorflow). However, keras uses tensorflow by default to run and this needs to be changed if the user has only installed theano and keras. This can be done by updating the ‘backend’ field from tensorflow to theano in the keras.json file which can be found in the user/.keras path.
below is the code I used to update the keras.json file using python.
import json
with open(‘keras.json’, ‘r’) as f:
json_data = json.load(f)
json_data[‘backend’] = “theano”
with open(‘keras.json’, ‘w’) as f:
f.write(json.dumps(json_data))
Well done Mayank!
Thanks for the tip.
Dear Jason,
your articles are best!!
Is there any flag in keras that is used to force keras to use either GPU or CPU
No. Use of CPU/GPU is configured in the underlying math library (theano or tensorflo).
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
sklearn: 0.18.1
statsmodels: 0.8.0
Great work Adarsh!
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.18.1
theano: 0.9.0
tensorflow: 1.2.1
Using TensorFlow backend.
keras: 2.0.6
Well done Adrian!
Thanks for the guide Jason. My output is:
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.2.1
Using TensorFlow backend.
keras: 2.0.6
Great work Adi.
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.18.1
Well done Geoff!
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.2.1
Using TensorFlow backend.
keras: 2.0.7
Nice one Geoff! Ready for deep learning.
Dr. Brownlee,
Thank you so much, can’t express how appreciated I am for this post. Problem solved, everything is installed and seems running perfectly.
theano: 0.9.0
tensorflow: 1.2.1
Using TensorFlow backend.
keras: 2.0.7
Well done, I’m glad to hear that.
Hello Doctor,
Here is my output:
scipy: 0.19.0
numpy: 1.11.3
matplotlib: 2.0.0
pandas: 0.19.2
statsmodels: 0.6.1
sklearn: 0.18.1
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.2.1
Using TensorFlow backend.
keras: 2.0.7
Thank you for tutorial, very concise and handy!
Well done Emil!
Ready Dr. Jason 🙂
C:\Users\realnica\Anaconda3>python deepversion.py
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.2.1
Using TensorFlow backend.
keras: 2.0.7
Well done Cesar!
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.18.1
theano: 0.9.0
tensorflow: 1.2.1
keras: 2.0.8
Well done rajat bansal!
Quick question, I already have Python 3.6 running on my windows machine. Does installing Anaconda3 install a second version of python? It sure looks like it from the directory.
Yes it does.
C:\Users\Icarus\Documents\Anaconda>python versions.py
Traceback (most recent call last):
File “versions.py”, line 2, in
import scipy
ImportError: No module named scipy
BUT WHEN I TYPE
C:\Users\Icarus\Documents\Anaconda>pip install scipy
Requirement already satisfied: scipy is c:\users\icarus\anaconda2\lib\site-packages
I’m confused, has anyone else seen this?
I’ve restarted my cmd after installing Anaconda as suggested earlier in this thread:
https://machinelearningmastery.com/setup-python-environment-machine-learning-deep-learning-anaconda/#comment-402177
Nice one!
Perhaps try rebooting your system?
Hi Jason
Thanks for the nice work.
I hv installes spyder 2.7.1 on my windows 10. and successfully installed theano and keras and I am able to run the script with theano version 0.9.0 but not able to run the script with keras after running the script i got this error.
runfile(‘C:/Users/Folio13 2000/Documents/Garima_files/Microsoft_datascience/06Video_Tutorial_Data_Science_Essential/Mod4/check2.py’, wdir=’C:/Users/Folio13 2000/Documents/Garima_files/Microsoft_datascience/06Video_Tutorial_Data_Science_Essential/Mod4′)
sklearn: 0.18.1
scipy: 0.18.1
theano: 0.9.0
Traceback (most recent call last):
File “”, line 1, in
runfile(‘C:/Users/Folio13 2000/Documents/Garima_files/Microsoft_datascience/06Video_Tutorial_Data_Science_Essential/Mod4/check2.py’, wdir=’C:/Users/Folio13 2000/Documents/Garima_files/Microsoft_datascience/06Video_Tutorial_Data_Science_Essential/Mod4′)
File “C:\ProgramData\Anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py”, line 866, in runfile
execfile(filename, namespace)
File “C:\ProgramData\Anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py”, line 87, in execfile
exec(compile(scripttext, filename, ‘exec’), glob, loc)
File “C:/Users/Folio13 2000/Documents/Garima_files/Microsoft_datascience/06Video_Tutorial_Data_Science_Essential/Mod4/check2.py”, line 18, in
import keras
File “C:\ProgramData\Anaconda2\lib\site-packages\keras\__init__.py”, line 3, in
from . import utils
File “C:\ProgramData\Anaconda2\lib\site-packages\keras\utils\__init__.py”, line 2, in
from . import np_utils
ImportError: cannot import name np_utils
can u plz suggest?
It looks like numpy might not be installed, or not installed correctly?
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.19.0
Nice work!
—————-
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.3.0
Traceback (most recent call last):
File “deep_versions.py”, line 9, in
print(‘keras: %s’ % keras.__version__)
AttributeError: module ‘keras’ has no attribute ‘__version__’
—————-
Is it alright?
Though keras is imported, it throws out an error while displaying its version.
It looks like keras might not be installed or not installed correctly
Try reinstalling?
Try rebooting?
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.3.0
Using TensorFlow backend.
keras: 2.0.8
Great work!
Thank you so much for this detailed help
You’re welcome.
😀
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.18.1
Great work Vlad!
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.3.0
Using TensorFlow backend.
keras: 2.0.8
WOOOHOOO
Very nice!
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.3.0
Using TensorFlow backend.
keras: 2.0.8
=) I am trying to use NNs to identify dynamical systems. I hope the blog could be useful for me. I am trying to follow the contents but I also would like to have an overview about NNs, could you give me some advice ? Thanks in advance 😉
Nice work Marco!
This might be a good place to start:
https://machinelearningmastery.com/start-here/#deeplearning
I’ve got a traceback just for doing the imports.
when trying to import keras, python returns.
“cannot import name utils”
That is odd. Perhaps confirm that you have everything installed.
nvm, I just installed everything in a conda virtual enviroment and worked smooth!
These are the results from my Windows 10 machine:
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.3.0
Using TensorFlow backend.
keras: 2.0.8
And these are from my Linux machine:
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.3.0
Using TensorFlow backend.
keras: 2.0.2
Any idea why keras would only go to 2.0.2 in Linux?
Great work.
Not sure, perhaps try upgrading keras?
Hello Jason:
Actually I’m installing software and my output is:
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.19.0
Great work Arelis!
Thank for your tutorials!
Win7 64bit. Installing Anaconda & Tensorflow ok
scipy: 0.19.1
numpy: 1.13.2
matplotlib: 2.0.2
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.0
But then trying to “pip install keras” gives the following errors:
Collecting keras
Exception:
Traceback (most recent call last):
File “C:\PYTHON\Anaconda\lib\site-packages\pip\basecommand.py”, line 215, in main
status = self.run(options, args)
File “C:\PYTHON\Anaconda\lib\site-packages\pip\commands\install.py”, line 335, in run
wb.build(autobuilding=True)
File “C:\PYTHON\Anaconda\lib\site-packages\pip\wheel.py”, line 749, in build
self.requirement_set.prepare_files(self.finder)
File “C:\PYTHON\Anaconda\lib\site-packages\pip\req\req_set.py”, line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File “C:\PYTHON\Anaconda\lib\site-packages\pip\req\req_set.py”, line 554, in _prepare_file
require_hashes
File “C:\PYTHON\Anaconda\lib\site-packages\pip\req\req_install.py”, line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File “C:\PYTHON\Anaconda\lib\site-packages\pip\index.py”, line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File “C:\PYTHON\Anaconda\lib\site-packages\pip\index.py”, line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File “C:\PYTHON\Anaconda\lib\site-packages\pip\index.py”, line 568, in _get_pages
page = self._get_page(location)
File “C:\PYTHON\Anaconda\lib\site-packages\pip\index.py”, line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File “C:\PYTHON\Anaconda\lib\site-packages\pip\index.py”, line 811, in get_page
inst = cls(resp.content, resp.url, resp.headers)
File “C:\PYTHON\Anaconda\lib\site-packages\pip\index.py”, line 731, in __init__
namespaceHTMLElements=False,
TypeError: parse() got an unexpected keyword argument ‘transport_encoding’
Instead I followed the “alternative” route of installing keras as by it´s documentation:
– Used GIT to clone the repository: git clone https://github.com/fchollet/keras.git
– Run from the local directory: python setup.py install
The versions script (without theano) then gives:
tensorflow: 1.3.0
Using TensorFlow backend.
keras: 2.0.8
Great work, well done!
I was able to get rid of it by “conda install -c conda-forge keras” and that’s it.
Thank you it worked
theano: 0.9.0
tensorflow: 1.3.0
Using Theano backend.
keras: 2.0.6
Very nice Nathan.
Some tips for Windows users:
1) Installing Anaconda with all of the default settings doesn’t add conda to the Windows path, so it isn’t recognized as a command in the Windows command window. You might see a ” ‘conda’ is not recognized as an internal or external command” error.
I worked around this by using the Anaconda Prompt, which seems to set up the environment properly.
A potential revision of the text would be
[…] 1. Open a terminal (command line window).
a. Windows users may want to go to the Start menu and use the “Anaconda Prompt”. […]
Checking the box to add Anaconda to the PATH during installation will probably also work, but I haven’t tried it myself.
2) TensorFlow is hard to install on Windows, but if you try skipping it, you can’t import Keras because it tries to use TensorFlow by default. You can get around this by changing the default Keras backend:
Suggested text revision:
[…] Save the script to a file deep_versions.py.
If you’re on Windows and skipped installing TensorFlow, you’ll want to change Keras’s default backend. Open C:\Users\\.keras\keras.json in a text editor and change the entry for “backend” from “tensorflow” to “therano”.
Run the script by typing: […]
Thanks Jonathan, I really appreciate the tips!
I hope that they help other Windows users.
Hello Jason:
I had a lot a trouble with my PC, but I could do it. This is my results:
[email protected]:~/anaconda2$ python deep_versions.py
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.3.0
Using TensorFlow backend.
keras: 2.0.8
[email protected]:~/anaconda2$
Well done Arelis!
scipy: 0.18.1
numpy: 1.13.3
matplotlib: 2.0.2
pandas: 0.20.3
statsmodels: 0.6.1
sklearn: 0.19.0
Great work Vladimir!
Thanks a lot for great tutorial, Jason !
I went smoothly without any minor issue.
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.3.0
Using TensorFlow backend.
keras: 2.0.8
Great work!
Thank you so much for a great tutorial!
I got the following versions installed:
scipy: 0.19.1
numpy: 1.13.1
matplotlib: 2.0.2
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.0
Great work Peter!
Everything went smooth:
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.3.0
Using TensorFlow backend.
keras: 2.0.8
Very nice!
F:\Python_Learning>python CheckVer.py
scipy: 0.19.1
numpy: 1.13.1
matplotlib: 2.0.2
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.0
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.3.0
Using TensorFlow backend.
keras: 2.0.6
Great work Jose!
Hi Jason,
Great post. I spent hours trying to get nvidia and an endless list of useless prerequisites…
When I got here, it took me 2 minutes.
So, thank you!
I’m glad to hear that it worked!
Awesome article . Yes Anaconda is one solution for all machine learning tasks .
Thanks.
scipy 0.19.1
numpy 1.13.1
matplotlib 2.0.2
pandas 0.20.3
statsmodels 0.8.0
sklearn 0.19.0
Great work!
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
Using Theano backend.
keras: 2.0.8
Great work!
Thank you,, very nice tutorial..
Thanks!
Hi Jason, I saw warnings, do you know what is the problem?
WARNING (theano.configdefaults): Only clang++ is supported. With g++, we end up with strange g++/OSX bugs.
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.3.0
Using TensorFlow backend.
keras: 2.0.8
Thanks!
Sorry, I don’t know about this warning.
Perhaps try a search or even a post to StackOverflow?
I do have an OS X specific tutorial here that may help:
https://machinelearningmastery.com/install-python-3-environment-mac-os-x-machine-learning-deep-learning/
This is my output:
scipy: 0.19.1
numpy: 1.13.1
matplotlib: 2.0.2
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.0
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.3.0
Using TensorFlow backend.
keras: 2.0.8
Thank you for the tutorial.
Well done Daniel!
?>python versions.py
scipy: 0.19.1
numpy: 1.13.3
matplotlib: 2.0.2
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.1
Well done Robert!
?>python lib_version.py
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.2.1
Using TensorFlow backend.
keras: 2.0.8
Great!
Many thanks for everything Jason. You are making my journey in learning ML techniques. The following is what I got:
scipy: 0.19.1
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.0
Deep Learning Libraries:
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.1.0
Using TensorFlow backend.
keras: 2.0.8
Well done!
scipy: 0.19.1
numpy: 1.13.3
matplotlib: 2.1.0
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.1
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.3.0
Using TensorFlow backend.
keras: 2.0.9
Well done Vladimir!
scipy: 0.19.1
numpy: 1.13.1
matplotlib: 2.1.0
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.0
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.3.0
Using TensorFlow backend.
keras: 2.0.6
Great work!
And thank you very much for the great helpful posts!
You’re welcome.
I got the following output
scipy: 0.19.1
numpy: 1.13.3
matplotlib: 2.1.0
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.1
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
Using Theano backend.
keras: 2.0.9
Nice work!
Thanks a lot jason!
You’re welcome.
Thanks Jason for such an awesome post!
I have installed the tools successfully but while importing keras, it is searching for tensorflow. i had installed only theano.
The error stacktrace is :
—-
import keras
File “C:\Users\…\AppData\Local\Continuum\anaconda3\lib\site-packages\keras\__init__.py”, line 3, in
from . import utils
File “C:\Users\…\AppData\Local\Continuum\anaconda3\lib\site-packages\keras\utils\__init__.py”, line 6, in
from . import conv_utils
File “C:\Users\…\AppData\Local\Continuum\anaconda3\lib\site-packages\keras\utils\conv_utils.py”, line 3, in
from .. import backend as K
File “C:\Users\…\AppData\Local\Continuum\anaconda3\lib\site-packages\keras\backend\__init__.py”, line 83, in
from .tensorflow_backend import *
File “C:\Users\…\AppData\Local\Continuum\anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py”, line 1, in
import tensorflow as tf
—-
#scipy: 0.19.1
#numpy: 1.13.3
#matplotlib: 2.1.0
#pandas: 0.20.3
#statsmodels: 0.8.0
#sklearn: 0.19.1
#theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
#Using TensorFlow backend.
You might need to reconfigure Keras to use Theano instead of the default TensorFlow. See the config file in ~/.keras/keras.json.
scipy: 0.19.1
numpy: 1.13.3
matplotlib: 2.1.0
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.1
theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291
tensorflow: 1.3.0
Using TensorFlow backend.
keras: 2.1.0
Very nice.
Well done!
theano: 0.9.0
tensorflow: 1.3.0
Using TensorFlow backend.
keras: 2.1.1
Well done Ankush!
Hi Dr. Jason
I met an issue while installing theano. Please look at the code below.
What should I do?
C:\ProgramData\Anaconda3) C:\Users\Pankaj Lab>conda install theano
Fetching package metadata ………….
Solving package specifications: .
Package plan for installation in environment C:\ProgramData\Anaconda3:
The following NEW packages will be INSTALLED:
libgpuarray: 0.6.9-vc14_0
libpython: 2.0-py36_0
m2w64-binutils: 2.25.1-5
m2w64-bzip2: 1.0.6-6
m2w64-crt-git: 5.0.0.4636.2595836-2
m2w64-gcc: 5.3.0-6
m2w64-gcc-ada: 5.3.0-6
m2w64-gcc-fortran: 5.3.0-6
m2w64-gcc-libgfortran: 5.3.0-6
m2w64-gcc-libs: 5.3.0-7
m2w64-gcc-libs-core: 5.3.0-7
m2w64-gcc-objc: 5.3.0-6
m2w64-gmp: 6.1.0-2
m2w64-headers-git: 5.0.0.4636.c0ad18a-2
m2w64-isl: 0.16.1-2
m2w64-libiconv: 1.14-6
m2w64-libmangle-git: 5.0.0.4509.2e5a9a2-2
m2w64-libwinpthread-git: 5.0.0.4634.697f757-2
m2w64-make: 4.1.2351.a80a8b8-2
m2w64-mpc: 1.0.3-3
m2w64-mpfr: 3.1.4-4
m2w64-pkg-config: 0.29.1-2
m2w64-toolchain: 5.3.0-7
m2w64-tools-git: 5.0.0.4592.90b8472-2
m2w64-windows-default-manifest: 6.4-3
m2w64-winpthreads-git: 5.0.0.4634.697f757-2
m2w64-zlib: 1.2.8-10
mako: 1.0.7-py36he15cdb7_0
msys2-conda-epoch: 20160418-1
pygpu: 0.6.9-py36_0
theano: 0.9.0-py36_0
Proceed ([y]/n)? y
CondaIOError: Missing write permissions in: C:\ProgramData\Anaconda3
#
# You don’t appear to have the necessary permissions to install packages
# into the install area ‘C:\ProgramData\Anaconda3’.
# However you can clone this environment into your home directory and
# then make changes to it.
# This may be done using the command:
#
# $ conda create -n my_root –clone=”C:\ProgramData\Anaconda3″
You might have a permissions issue on your machine?
scipy: 0.19.1
numpy: 1.13.3
matplotlib: 2.1.0
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.1
Great work John!
scipy: 0.19.1
numpy: 1.13.3
matplotlib: 2.1.0
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.1
Nice work sona!
I have to write a python program to load pre-trained vectors and compute cosine similarities. And i have to adapt it to compute the 353 similarities on the two given word embedded models and then to compute the correlation with human judgement.
Using the two models:
– Word2Vec
– Glove
I want to know what i need exactly tod perform this work.
Sorry, I cannot spec this homework for you.
scipy: 0.19.1
numpy: 1.13.3
matplotlib: 2.1.0
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.1
Nice work David!
Hi Jason how what platform do you use to make you blog posts. I am build an ML blog and I want to be able to include the code snippets.
I use wordpress. Good luck with your blog!
Hi Jason,
>>> import theano
>>> print(‘theano: %s’ % theano.__version__)
theano: 0.9.0.dev-425cb8effc7958e8ca376b023d8344b7620a9622
>>> # tensorflow
… import tensorflow
>>> print(‘tensorflow: %s’ % tensorflow.__version__)
tensorflow: 1.4.0
>>> # keras
… import keras
Using TensorFlow backend.
>>> print(‘keras: %s’ % keras.__version__)
keras: 2.1.2
Well done!
after install thano then install tensoflow
and i have a window 10 and typping the same command you wrote
but when install keras i have a problem these is a message
(C:\Users\NAZEK – PC\Anaconda3) C:\Users\NAZEK – PC>cd ..
(C:\Users\NAZEK – PC\Anaconda3) C:\Users>cd ..
(C:\Users\NAZEK – PC\Anaconda3) C:\>pip install keras
Collecting keras
Exception:
Traceback (most recent call last):
File “C:\Users\NAZEK – PC\Anaconda3\lib\site-packages\pip\basecommand.py”, line 215, in main
status = self.run(options, args)
File “C:\Users\NAZEK – PC\Anaconda3\lib\site-packages\pip\commands\install.py”, line 335, in run
wb.build(autobuilding=True)
File “C:\Users\NAZEK – PC\Anaconda3\lib\site-packages\pip\wheel.py”, line 749, in build
self.requirement_set.prepare_files(self.finder)
File “C:\Users\NAZEK – PC\Anaconda3\lib\site-packages\pip\req\req_set.py”, line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File “C:\Users\NAZEK – PC\Anaconda3\lib\site-packages\pip\req\req_set.py”, line 554, in _prepare_file
require_hashes
File “C:\Users\NAZEK – PC\Anaconda3\lib\site-packages\pip\req\req_install.py”, line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File “C:\Users\NAZEK – PC\Anaconda3\lib\site-packages\pip\index.py”, line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File “C:\Users\NAZEK – PC\Anaconda3\lib\site-packages\pip\index.py”, line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File “C:\Users\NAZEK – PC\Anaconda3\lib\site-packages\pip\index.py”, line 568, in _get_pages
page = self._get_page(location)
File “C:\Users\NAZEK – PC\Anaconda3\lib\site-packages\pip\index.py”, line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File “C:\Users\NAZEK – PC\Anaconda3\lib\site-packages\pip\index.py”, line 811, in get_page
inst = cls(resp.content, resp.url, resp.headers)
File “C:\Users\NAZEK – PC\Anaconda3\lib\site-packages\pip\index.py”, line 731, in __init__
namespaceHTMLElements=False,
TypeError: parse() got an unexpected keyword argument ‘transport_encoding’
(C:\Users\NAZEK – PC\Anaconda3) C:\>
please help me
I’m sorry to hear that, I don’t have any good ideas. Perhaps post the error on StackOverflow?
I am not sure if you were able to solve this problem, but I was able to solve it by below command:
conda install pip
Let me know if it helps!
H
Thanks for sharing.
scipy: 0.19.1
numpy: 1.13.3
matplotlib: 2.1.0
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.1
————————
theano: 0.9.0.dev-425cb8effc7958e8ca376b023d8344b7620a9622
tensorflow: 1.4.0
Using TensorFlow backend.
keras: 2.1.2
Very nice!
theano: 0.9.0.dev-unknown-git
tensorflow: 1.4.0
Using TensorFlow backend.
keras: 2.0.8
Great work!
Hi Jason,
having trouble with installing scikit learn. getting a syntax error: invalid syntax
Ensure you are on the command prompt and not in the Python REPL.
Running Versions.py
scipy: 1.0.0
numpy: 1.12.3
matplotlib: 2.1.1
pandas: 0.21.1
statsmodels: 0.8.0
sklearn: 0.19.1
However, I’m currently running issues on importing theano in python. I was able to download it with the “conda install theano” command, but when I try to import, python crashes and some of the traceback is shown below:
^. C:\Users\Mei\AppData\Local\Theano\compiled
ir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-2.7.
14-64\lazylinker_ext\mod.cpp:744:33: error: ‘struct CLazyLinker’ has no member n
amed ‘node_n_inputs’. for (int i = 0; i node_n_inputs[owner_idx];
Any suggestions on how to tackle this issue?
Perhaps try installing TensorFlow instead?
Ended up switching to canopy, but everything works now! Current output for both scripts as follows:
scipy: 1.0.0
numpy: 1.12.3
matplotlib: 2.1.1
pandas: 0.21.1
statsmodels: 0.8.0
sklearn: 0.19.1
theano: 1.0.1
Using Theano backend
Keras: 2.1.2
Thank you for running such an awesome website!
Well done!
Thanks for the post.
Is there any specific reason why you are using pip for installing keras instead of
conda install -c conda-forge keras?
Yes, I believed pip was kept more up to date, you can use anything you wish.
Thank You for the guide:
Here are my outputs:
scipy: 1.0.0
numpy: 1.13.3
matplotlib: 2.1.1
pandas: 0.21.1
statsmodels: 0.8.0
sklearn: 0.19.1
tensorflow: 1.4.0
Using TensorFlow backend.
keras: 2.0.8
Well done!
theano: 0.9.0.dev-unknown-git
tensorflow: 1.4.0
keras: 2.0.8
Well done!
Thanks for the guide
scipy: 0.19.1
numpy: 1.13.3
matplotlib: 2.1.0
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.1
Well done!
scipy: 0.19.1
numpy: 1.13.1
matplotlib: 2.0.2
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.0
Well done Joel!
scipy: 0.18.1
numpy: 1.11.1
matplotlib: 1.5.3
pandas: 0.18.1
statsmodels: 0.6.1
sklearn: 0.17.1
Well done!
I got the following:
scipy: 0.19.1
numpy: 1.13.3
matplotlib: 2.1.0
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.1
Well done Aaron!
With little struggle for Keras installation ( I mean after “conda install pip” twice)..
Python: 3.6.2
scipy: 0.19.1
numpy: 1.13.1
matplotlib: 2.0.2
pandas: 0.20.3
sklearn: 0.19.1
&
tensorflow: 1.3.0
Using TensorFlow backend.
keras: 2.1.2
statsmodels: 0.8.0
Well done!
scipy: 0.19.1
numpy: 1.13.1
matplotlib: 2.0.2
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.0
Nice work!
Johns-MacBook-Pro-2:pyscripts jdnewell$ python versions.py
scipy: 0.19.1
numpy: 1.13.1
matplotlib: 2.0.2
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.0
/Users/jdnewell/anaconda3/lib/python3.6/site-packages/theano/configdefaults.py:560: UserWarning: DeprecationWarning: there is no c++ compiler.This is deprecated and with Theano 0.11 a c++ compiler will be mandatory
warnings.warn(“DeprecationWarning: there is no c++ compiler.”
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
theano: 1.0.1
/Users/jdnewell/anaconda3/lib/python3.6/importlib/_bootstrap.py:205: RuntimeWarning: compiletime version 3.5 of module ‘tensorflow.python.framework.fast_tensor_util’ does not match runtime version 3.6
return f(*args, **kwds)
tensorflow: 1.4.1
Using TensorFlow backend.
keras: 2.1.2
It looks like warnings that you could ignore.
Perhaps there is documentation on how you can install an alternate version better suited to your specific hardware?
Great, got my environment up and running.
First you need to downgrade python as suggested to 3.5.
Theano I had to install specific version as upgrade result in error
scipy: 1.0.0
numpy: 1.13.3
matplotlib: 2.1.1
pandas: 0.21.1
statsmodels: 0.8.0
sklearn: 0.19.1
theano: 0.8.2
tensorflow: 1.2.1
Using Theano backend.
keras: 2.0.8
Nice work!
Thank you Jason for such a comprehensive writing. MachineLearningMastery truely making marks in creating masters of machine learning.
You’re welcome, I’m glad it helps.
scipy: 0.19.1
numpy: 1.13.3
matplotlib: 2.1.0
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.1
theano: 0.9.0.dev-unknown-git
tensorflow: 1.4.0
Using TensorFlow backend.
keras: 2.0.9
Well done!
Thank you for this incredibly useful blog. I have programmed in assembly language, pascal Delphi and C++. I started an AI project in Delphi and thought PYTHON should be a much easier track, so I went with Anaconda3. Little did I know that I would be spending most of my time simply trying to reconcile the differences between documented language usage and the updated Python 3.5.
Here is my output from following your instructions:
scipy: 0.19.1
numpy: 1.13.3
matplotlib: 2.1.0
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.1
tensorflow: 1.4.0
Using TensorFlow backend.
keras: 2.1.2
Writing computer instructional material is very difficult and is a unique skill. Your instructions are clear, precise and on point. Glad I found your blog, glad I found your book. I’ve signed up for you email.
Thanks and well done Lynard!
Hang in there.
how to install tensorflow in windows 32 bit, i have searching this for past 1 week, i know it is a basic question but i need a help.
I have tried most of the way by setting virtual environment thing and all.
(tensorflow)C:> pip install — ignore-installed — upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl
above mentioned query is working but it is for 64 bit and i need for 32 bit.
could you please help me.
Perhaps use Theano instead?
i’ve had about enough with import errors and labelencoder errors. tried to setup the environment several times on mac os and windows 10, followed these instructions each time and each time i got proper versions for the installed packages. it all goes south when i try to import the packages or when i execute the labelencoder command. i’m this close to installing linux and trying it over there. but really, it’s the 5th time i’m reinstalling anaconda3 and pycharm, frustrating as [email protected]#.
Sorry to hear that. The tutorial has seemed to work for tens of thousands of others.
– Perhaps you need to reboot after install?
– Perhaps you have 2 versions of Python installed accidentally, e.g. Python and anaconda?
– Perhaps you are trying to run code in the wrong place?
What errors are you getting exactly?
The errors i’ve encountered were diverse, haven’t written them down because i’ve always tried to do fresh installs hoping it will work. Thanks for the reply, i’ll talk to some programmer friends of mine, surely they can help. I’ll get back to you if i’ve got better questions 😛
Hang in there!
i’m using a 3 year old MacBook pro without any special video cards. is it safe to install deep learning libraries? I heard somewhere that it will burn the processor? (I’m completely new to this, sorry if the questions are dumb…).
Also, do you suggest Theano or Tensorflow for the macbook? Is there any difference for when actually using them?
I’m still learning with a plan of getting to do Kaggle competitions.
I already have anaconda and scikitlearn installed
I think it will be fine. If you’re worried, I’d recommend using AWS:
https://machinelearningmastery.com/develop-evaluate-large-deep-learning-models-keras-amazon-web-services/
Good Night
scipy: 0.19.1
numpy: 1.13.1
matplotlib: 2.0.2
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.0
Well done!
could you please give a tutorial which shows how to use the workstation I am totally confused about using the anaconda app.
P.S- I have successfully installed all what mentioned above.
TIA
I recommend using a text editor and running Python files on the command line.
scipy: 0.19.1
numpy: 1.13.3
matplotlib: 2.1.0
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.1
Very nice!
Hello Dr. Jason Brownlee
I want to ask you, how to download tweets from hashtags or from users on Twitter to visualization data?
I use anaconda with the package tweepy, and my the OS windows.
can you help me, please?
thank you about the steps of machine learning, the output for me is
scipy: 0.19.1
numpy: 1.13.3
matplot lib : 2.1.0
pandas: 0.20.3
statsmodels: 0.8.1
sklearn : 0.19.1
I don’t know about downloading twiter hashtags sorry.
Thanks Jason, so far so good! 🙂
scipy: 0.19.1
numpy: 1.13.3
matplotlib: 2.1.0
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.1
And after some grappling:
theano: 1.0.1
tensorflow: 1.4.0
Using TensorFlow backend.
keras: 2.1.2
…phew.
You made it!
Nice work!
WOW,, Cool, i think this is more hard, but you explain it, and everything like piece of cake..
Thanks you so much..
scipy: 0.19.1
numpy: 1.13.3
matplotlib: 2.1.0
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.1
Great work!
i can see the libraries (matplotlib, statsmodels) installed but when i import them to my program, it gives me error. like module not found. i have set the enviroment variables as well, installed python, Anaconda, and updated both. still no use. kindly help me i am not getting any help from any other sites as well.
Are you running code from the command line?
Your suggestions for working with NLP – Is it better to use Spacy or scikit or textblob. Pls suggest
It depends on your project goals.
Error:::
(C:\Users\Mpkyut\Anaconda3) C:\Users\Mpkyut\Desktop\pytest>python deep_version.p
y
Traceback (most recent call last):
File “C:\Users\Mpkyut\Anaconda3\lib\configparser.py”, line 1138, in _unify_val
ues
sectiondict = self._sections[section]
KeyError: ‘blas’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\Users\Mpkyut\Anaconda3\lib\site-packages\theano\configparser.py”, lin
e 168, in fetch_val_for_key
return theano_cfg.get(section, option)
File “C:\Users\Mpkyut\Anaconda3\lib\configparser.py”, line 781, in get
d = self._unify_values(section, vars)
File “C:\Users\Mpkyut\Anaconda3\lib\configparser.py”, line 1141, in _unify_val
ues
raise NoSectionError(section)
configparser.NoSectionError: No section: ‘blas’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\Users\Mpkyut\Anaconda3\lib\site-packages\theano\configparser.py”, lin
e 328, in __get__
delete_key=delete_key)
File “C:\Users\Mpkyut\Anaconda3\lib\site-packages\theano\configparser.py”, lin
e 172, in fetch_val_for_key
raise KeyError(key)
KeyError: ‘blas.ldflags’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “deep_version.py”, line 2, in
import theano
File “C:\Users\Mpkyut\Anaconda3\lib\site-packages\theano\__init__.py”, line 12
4, in
from theano.scan_module import (scan, map, reduce, foldl, foldr, clone,
File “C:\Users\Mpkyut\Anaconda3\lib\site-packages\theano\scan_module\__init__.
py”, line 41, in
from theano.scan_module import scan_opt
File “C:\Users\Mpkyut\Anaconda3\lib\site-packages\theano\scan_module\scan_opt.
py”, line 60, in
from theano import tensor, scalar
File “C:\Users\Mpkyut\Anaconda3\lib\site-packages\theano\tensor\__init__.py”,
line 17, in
from theano.tensor import blas
File “C:\Users\Mpkyut\Anaconda3\lib\site-packages\theano\tensor\blas.py”, line
155, in
from theano.tensor.blas_headers import blas_header_text
File “C:\Users\Mpkyut\Anaconda3\lib\site-packages\theano\tensor\blas_headers.p
y”, line 987, in
if not config.blas.ldflags:
File “C:\Users\Mpkyut\Anaconda3\lib\site-packages\theano\configparser.py”, lin
e 332, in __get__
val_str = self.default()
File “C:\Users\Mpkyut\Anaconda3\lib\site-packages\theano\configdefaults.py”, l
ine 1430, in default_blas_ldflags
check_mkl_openmp()
File “C:\Users\Mpkyut\Anaconda3\lib\site-packages\theano\configdefaults.py”, l
ine 1252, in check_mkl_openmp
raise RuntimeError(‘To use MKL 2018 with Theano you MUST set “MKL_THREADING_
LAYER=GNU” in your environement.’)
RuntimeError: To use MKL 2018 with Theano you MUST set “MKL_THREADING_LAYER=GNU”
in your environement.
(C:\Users\Mpkyut\Anaconda3) C:\Users\Mpkyut\Desktop\pytest>
Looks like there may be issues with your installation.
Perhaps try posting your error to stackoverflow?
I had a similar issue and solved it by following the next steps:
1. Go to the Windows search on the task bar and look for “Edit the system environment variables”. The best match be something in the control panel. Click it.
2. Click on “Environment Variables…”
3. Click on “New…”. In “Variable name” fill in “MKL_THREADING_LAYER”. In “Variable value” fill in “GNU” (no quotations in any case)
4. Click “OK” on each open dialogue
5. Restart Windows.
That did it for me!
Last but not least, thank you, Jason, for such a helpful tutorial
Thanks for sharing!
thanks!!!!!!!
It works to me as well. Thanks!!
Thank you, Arturo. Also it looks like you don’t have to restart Windows, just the console session.
theano: 1.0.3
tensorflow: 1.13.1
Using TensorFlow backend.
keras: 2.2.4
Well done!
First Thanks a lot for the good Steps.
theano: 1.0.1
tensorflow: 1.4.0
keras: 2.1.2
Well done!
Hi Jason,
(C:\ProgramData\Anaconda3) e:\emachine\python-projects>python version.py
scipy: 0.19.1
numpy: 1.13.3
matplotlib: 2.1.0
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.1
but the deep_version does not like Theano on Win10 I suppose:
(C:\ProgramData\Anaconda3) e:\emachine\python-projects>python deep_versions.py
Traceback (most recent call last):
File “C:\ProgramData\Anaconda3\lib\configparser.py”, line 1138, in _unify_values
sectiondict = self._sections[section]
KeyError: ‘blas’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\configparser.py”, line 168, in fetch_val_for_key
return theano_cfg.get(section, option)
File “C:\ProgramData\Anaconda3\lib\configparser.py”, line 781, in get
d = self._unify_values(section, vars)
File “C:\ProgramData\Anaconda3\lib\configparser.py”, line 1141, in _unify_values
raise NoSectionError(section)
configparser.NoSectionError: No section: ‘blas’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\configparser.py”, line 328, in __get__
delete_key=delete_key)
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\configparser.py”, line 172, in fetch_val_for_key
raise KeyError(key)
KeyError: ‘blas.ldflags’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “deep_versions.py”, line 2, in
import theano
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\__init__.py”, line 124, in
from theano.scan_module import (scan, map, reduce, foldl, foldr, clone,
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\scan_module\__init__.py”, line 41, in
from theano.scan_module import scan_opt
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\scan_module\scan_opt.py”, line 60, in
from theano import tensor, scalar
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\tensor\__init__.py”, line 17, in
from theano.tensor import blas
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\tensor\blas.py”, line 155, in
from theano.tensor.blas_headers import blas_header_text
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\tensor\blas_headers.py”, line 987, in
if not config.blas.ldflags:
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\configparser.py”, line 332, in __get__
val_str = self.default()
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\configdefaults.py”, line 1430, in default_blas_ldflags
check_mkl_openmp()
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\configdefaults.py”, line 1252, in check_mkl_openmp
raise RuntimeError(‘To use MKL 2018 with Theano you MUST set “MKL_THREADING_LAYER=GNU” in your environement.’)
RuntimeError: To use MKL 2018 with Theano you MUST set “MKL_THREADING_LAYER=GNU” in your environement.
Only when I commented out the Theano part I ‘ve got:
(C:\ProgramData\Anaconda3) e:\emachine\python-projects>python deep_versions.py
tensorflow: 1.4.0
Using TensorFlow backend.
keras: 2.1.3
Thank you very much for those tutorials!
Kind regrds,
Piotr
Nice, ignore Theano and stick to tensorflow then.
Is it work if I use python 2.7 version?
Yes, in most cases.
Hello
thank you for your help for installing Anaconda .
I have done steps on your procedure, until step 5 for installing theano .
l got the below error.
I would really thank you ,if you help me.
Downloading and Extracting Packages
certifi 2017.11.5: ############################################################################################ | 100%
openssl 1.0.2n: #####################################################5 | 56%
ca-certificates 2017.08.26: ################################################################################### | 100%
conda 4.4.7: ################################################################################################## | 100%
m2w64-gcc 5.3.0: ############################################################################################## | 100%
CondaError: Downloaded bytes did not match Content-Length
url: https://repo.continuum.io/pkgs/main/win-64/openssl-1.0.2n-h74b6da3_0.tar.bz2
target_path: C:\Users\ASUS\Anaconda3\pkgs\openssl-1.0.2n-h74b6da3_0.tar.bz2
Content-Length: 5622655
downloaded bytes: 4225957
Perhaps skip Theano?
hello
I again face to a new error during installing tensorflow:
(base) C:\Users\ASUS>conda install -c conda-forge tensorflow
Solving environment: done
## Package Plan ##
environment location: C:\Users\ASUS\Anaconda3
added / updated specs:
– tensorflow
The following packages will be downloaded:
package | build
—————————|—————–
tensorflow-1.4.0 | py36_0 24.4 MB conda-forge
ca-certificates-2017.11.5 | 0 182 KB conda-forge
conda-4.3.33 | py36_0 539 KB conda-forge
————————————————————
Total: 25.1 MB
The following NEW packages will be INSTALLED:
markdown: 2.6.9-py36_0 conda-forge
protobuf: 3.5.1-py36_vc14_3 conda-forge [vc14]
tensorboard: 0.4.0rc3-py36_2 conda-forge
tensorflow: 1.4.0-py36_0 conda-forge
The following packages will be UPDATED:
ca-certificates: 2017.08.26-h94faf87_0 anaconda –> 2017.11.5-0 conda-forge
certifi: 2017.11.5-py36hb8ac631_0 anaconda –> 2017.11.5-py36_0 conda-forge
openssl: 1.0.2n-h74b6da3_0 anaconda –> 1.0.2n-vc14_0 conda-forge [vc14]
The following packages will be DOWNGRADED:
bleach: 2.0.0-py36h0a7e3d6_0 –> 1.5.0-py36_0 conda-forge
conda: 4.4.7-py36_0 anaconda –> 4.3.33-py36_0 conda-forge
html5lib: 0.999999999-py36ha09b1f3_0 –> 0.9999999-py36_0 conda-forge
zlib: 1.2.11-vc14h1cdd9ab_1 –> 1.2.11-vc14_0 conda-forge [vc14]
Proceed ([y]/n)? y
Downloading and Extracting Packages
tensorflow 1.4.0: ############################################################################################# | 100%
ca-certificates 2017.11.5: #################################################################################### | 100%
conda 4.3.33: ################################################################################################# | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
The batch file cannot be found.
thanks for your help
What is the problem? It looks fine.
Hey Jason, this is really precious help !
I’ve installed everything without any error messages, on Mac OS 10.13.2
>>> theano.__version__
‘1.0.1’
>>> tensorflow.__version__
‘1.4.0’
>>> keras.__version__
‘2.1.3’
>>>
Well done!
at the last line ,”the batch file can not be found ” dose not make any problem?
thanks alot
I have not seen that before, sorry.
I use container – https://hub.docker.com/r/continuumio/anaconda3/ and update it based on your instructions above.
scipy: 0.19.1
numpy: 1.13.3
matplotlib: 2.1.0
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.1
Well done!
I get these versions:
scipy: 0.19.1
numpy: 1.13.3
matplotlib: 2.1.0
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.1
Well done!
Hi, Thank you so much for the step-by-step tutorial, it’s extremely helpful!!!
scipy: 0.19.1
numpy: 1.13.3
matplotlib: 2.1.0
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.1
I will follow the instructions in your article of first ML project to finish my ML prediction project. Thank you soooooo much!!!!
Well done!
Hi , i use Python 3.6.3 |Anaconda custom (64-bit) ubuntu 16.04 64 bits. I have an import error of tensorflow. How to solve it? Thanks
ModuleNotFoundError Traceback (most recent call last)
in ()
—-> 1 import tensorflow as tf
ModuleNotFoundError: No module named ‘tensorflow’
Perhaps tensorflow has not been installed?
I installed tensorflow. I did the following steps:
1. conda create -n tensorflow pip python=3.6
2. source activate tensorflow
3. pip install –ignore-installed –upgrade \ https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.5.0-cp36-cp36m-linux_x86_64.whl
Thanks for sharing!
Hello
typing the code of Lesson 05: First Neural Net in Keras in the free mini course,
how can I find what is my current working directory to download the database “pima-indians-diabetes.csv.”?
I download it from internet and then upload it in ” Anaconda3, Lib, site-packages, keras, datasets ,”
but again I face to this error,please help me…
from keras.models import Sequential
2 from keras.layers import Dense
3 import numpy
4 seed = 7
5 numpy.random.seed(seed)
6 # Load the dataset
7 dataset = numpy.loadtxt(“pima-indians-diabetes.csv”, delimiter=”,”)
FileNotFoundError Traceback (most recent call last)
in ()
—-> 1 dataset = numpy.loadtxt(“pima-indians-diabetes.csv”, delimiter=”,”)
~\Anaconda3\lib\site-packages\numpy\lib\npyio.py in loadtxt(fname, dtype, comments, delimiter, converters, skiprows, usecols, unpack, ndmin)
896 fh = iter(open(fname, ‘U’))
897 else:
–> 898 fh = iter(open(fname))
899 else:
900 fh = iter(fname)
FileNotFoundError: [Errno 2] No such file or directory: ‘pima-indians-diabetes.csv’
I recommend working from the command line.
The “current directory” is the directory on the command line where the code and data are located and the same place from where you execute the script.
I instal tensorflow under anaconda as indicated above but the same problem:
ModuleNotFoundError: No module named ‘tensorflow’
I do not know where the problem
The error suggests tensorflow is not installed or is installed but is not available in the python environment you have started.
These are the versions I got after I installed the Deep Learning libraries today, 5 Feb 2018:
theano: 1.0.1
tensorflow: 1.5.0
Using TensorFlow backend.
keras: 2.1.3
I would like to add that I looked up the instructions for installing TensorFlow on WIn7, which requested that I set up a special “tensorflow space” in conda first. By then I had already installed theano, and after installing tensorflow I left the “tensorflow space” and installed keras.
Nothing worked then; but after going back to the “tensorflow space” and again installed theano and keras there, everything worked fine. So keep an eye on any change of “space in conda you might be asked to do; an installation is “space-specific”. See also “https://www.tensorflow.org/install/install_windows”.
It also seems that in order to have a “good” implementation of theano, you need a c++ compiler installed. Without that, you apparently get a low-performance version of (some?) libraries.
Well done, thanks for sharing your experience.
Thanks for the tutorial.
scipy: 0.19.1
numpy: 1.13.3
matplotlib: 2.1.0
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.1
Well done!
i encountered an error:
raise RuntimeError(‘To use MKL 2018 with Theano you MUST set “MKL_THREADING_LAYER=GNU” in your environment.’)
RuntimeError: To use MKL 2018 with Theano you MUST set “MKL_THREADING_LAYER=GNU” in your environment.
any idea how to resolve this?
Sorry, I have not seen this error.
Perhaps try searching/posting on stackoverflow?
Hi! I’m having a problem here (Windows machine):
(base) C:\Users\andrz>python deep_versions.py
Traceback (most recent call last):
File “C:\Users\andrz\Anaconda3\lib\configparser.py”, line 1138, in _unify_values
sectiondict = self._sections[section]
KeyError: ‘blas’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\configparser.py”, line 168, in fetch_val_for_key
return theano_cfg.get(section, option)
File “C:\Users\andrz\Anaconda3\lib\configparser.py”, line 781, in get
d = self._unify_values(section, vars)
File “C:\Users\andrz\Anaconda3\lib\configparser.py”, line 1141, in _unify_values
raise NoSectionError(section)
configparser.NoSectionError: No section: ‘blas’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\configparser.py”, line 328, in __get__
delete_key=delete_key)
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\configparser.py”, line 172, in fetch_val_for_key
raise KeyError(key)
KeyError: ‘blas.ldflags’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “deep_versions.py”, line 2, in
import theano
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\__init__.py”, line 124, in
from theano.scan_module import (scan, map, reduce, foldl, foldr, clone,
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\scan_module\__init__.py”, line 41, in
from theano.scan_module import scan_opt
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\scan_module\scan_opt.py”, line 60, in
from theano import tensor, scalar
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\tensor\__init__.py”, line 17, in
from theano.tensor import blas
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\tensor\blas.py”, line 155, in
from theano.tensor.blas_headers import blas_header_text
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\tensor\blas_headers.py”, line 987, in
if not config.blas.ldflags:
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\configparser.py”, line 332, in __get__
val_str = self.default()
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\configdefaults.py”, line 1430, in default_blas_ldflags
check_mkl_openmp()
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\configdefaults.py”, line 1252, in check_mkl_openmp
raise RuntimeError(‘To use MKL 2018 with Theano you MUST set “MKL_THREADING_LAYER=GNU” in your environement.’)
RuntimeError: To use MKL 2018 with Theano you MUST set “MKL_THREADING_LAYER=GNU” in your environement.
Perhaps try posting on stackoverflow?
This worked: “set MKL_THREADING_LAYER=GNU”
But now I got:
theano: 1.0.1
Traceback (most recent call last):
File “deep_versions.py”, line 5, in
import tensorflow
ModuleNotFoundError: No module named ‘tensorflow’
The instructions said that I don’t need tensorflow if I install Theano. Does it mean I’m goof to go further now?
Nice work!
Yes, just one of tensorflow or theano is required.
versions.py
scipy: 1.0.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.19.1
scipy: 1.0.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.19.1
deep_versions.py
tensorflow: 1.4.0
Using TensorFlow backend.
keras: 2.1.3
Very nice!
HI,
I am getting following error for theano
Exception: Compilation failed (return status=1): In file included from /Users/Supriya/.theano/compiledir_Darwin-17.4.0-x86_64-i386-64bit-i386-3.6.3-64/lazylinker_ext/mod.cpp:1:. In file included from /Users/Supriya/anaconda3/include/python3.6m/Python.h:25:. /Users/Supriya/anaconda3/bin/../include/c++/v1/stdio.h:108:15: fatal error: ‘stdio.h’ file not found. #include_next . ^~~~~~~~~. 1 error generated..
I’m sorry to heat that, I have not seen this error. Perhaps try searching/posting on stackoverflow?
Yeah Im getting the same thing!
I am getting the same error
scipy: 0.19.1
numpy: 1.13.3
matplotlib: 2.1.0
pandas: 0.20.3
statsmodels: 0.8.0
sklearn: 0.19.1
Nice work!
$ python3 versions.py
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.18.1
Well done!
Heyy, I’m pretty new to the site. I have been exploring it and it seems like I’ve found a breath of fresh air from the textbooks I’ve been reading. Great work on the site and the level of your responsiveness to each comment is really nice. Please keep up the good work.
Thanks Timmy!
$ python ver2.py
tensorflow: 1.4.1
Using TensorFlow backend.
2018-02-13 12:20:13.042725: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
keras: 2.0.9
Well done!
scipy: 1.0.0
numpy: 1.13.3
matplotlib: 2.1.2
pandas: 0.22.0
statsmodels: 0.8.0
sklearn: 0.19.1
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
theano: 1.0.1
tensorflow: 1.5.0
Using TensorFlow backend.
keras: 2.1.3
Thanks Jason!
Well done!
Hi Jason,
I installd all the library.
I got :
sklearn: 0.19.1
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
theano: 1.0.1
I searched StackOverFlow.This can be fixed by:
sudo apt-get install libblas-dev
but I’m running on Windows.Do you know how to install libblas-dev on Windows10?
Sorry, I have not used windows.
I wonder if one ought to consider downgrading tensorflow when performing the installation on an iMac Pro. It would appear that the GPU is not used in the version I have installed. Do you have any recommendations for setting ML/DL environment tailored for an iMac Pro (mine has 18 cores). I want to make sure it takes full advantage of the hardware. I can confirm Anaconda does use the 18 cores, however I do not see hyper threading taking place, nor is the GPU being used.
GPU support only works with nvidia video cards as far as I know and all the macs I’ve owned come with radeon (or something).
I recommend dev/spot checking on the workstation and running large models on the GPU on AWS:
https://machinelearningmastery.com/develop-evaluate-large-deep-learning-models-keras-amazon-web-services/
Hi Jason,
Here’s my output.
scipy: 1.0.0
numpy: 1.14.0
matplotlib: 2.1.2
pandas: 0.22.0
statsmodels: 0.8.0
sklearn: 0.19.1
Regards,
Cor
Well done!
I am completely new to this. I tried following the above steps and am getting this error. Its Windows machine so as per the advice have not done
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
theano: 1.0.1
Traceback (most recent call last):
File “deep_versions.py”, line 5, in
import tensorflow
ModuleNotFoundError: No module named ‘tensorflow’
Please help
It looks like you have Theano installed and you got a warning. You can ignore the warning.
It also looks like you might need to change the configuration of Keras to use Theano instead of tensorflow. You can do that in the ~/.keras/keras.json config file.
Then comment out the line in deep_versions.py for tensorflow and try re-running it.
Let me know how you go.
This is what I get:
(base) C:\Users\Niketa Gandhi>python deep_versions.py
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
theano: 1.0.1
C:\Users\Niketa Gandhi\Anaconda3\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from
float
tonp.floating
is deprecated. In future, it will be treated asnp.float64 == np.dtype(float).type
.from ._conv import register_converters as _register_converters
Using Theano backend.
keras: 2.1.4
(base) C:\Users\Niketa Gandhi>
=====
My files
keras
{
“floatx”: “float32”,
“epsilon”: 1e-07,
“backend”: “theano”,
“image_data_format”: “channels_last”
}
deep_versions
# theano
import theano
print(‘theano: %s’ % theano.__version__)
# tensorflow
#import tensorflow
#print(‘tensorflow: %s’ % tensorflow.__version__)
# keras
import keras
print(‘keras: %s’ % keras.__version__)
Nice work!
You can ignore those warnings I believe.
scipy: 0.19.0
numpy: 1.11.3
matplotlib: 1.5.3
pandas: 0.18.1
Traceback (most recent call last):
File “versions.py”, line 14, in
import statsmodels
File “C:\Users\ransh\g2conda\lib\site-packages\statsmodels\__init__.py”, line 8, in
from .tools.sm_exceptions import (ConvergenceWarning, CacheWriteWarning,
File “C:\Users\ransh\g2conda\lib\site-packages\statsmodels\tools\__init__.py”, line 1, in
from .tools import add_constant, categorical
File “C:\Users\ransh\g2conda\lib\site-packages\statsmodels\tools\tools.py”, line 9, in
from statsmodels.distributions import (ECDF, monotone_fn_inverter,
File “C:\Users\ransh\g2conda\lib\site-packages\statsmodels\distributions\__init__.py”, line 1, in
from .empirical_distribution import ECDF, monotone_fn_inverter, StepFunction
File “C:\Users\ransh\g2conda\lib\site-packages\statsmodels\distributions\empirical_distribution.py”, line 5, in
from scipy.interpolate import interp1d
File “C:\Users\ransh\g2conda\lib\site-packages\scipy\interpolate\__init__.py”, line 176, in
from .interpolate import *
File “C:\Users\ransh\g2conda\lib\site-packages\scipy\interpolate\interpolate.py”, line 21, in
import scipy.special as spec
File “C:\Users\ransh\g2conda\lib\site-packages\scipy\special\__init__.py”, line 640, in
from ._ufuncs import *
ImportError: DLL load failed: The specified module could not be found.
I’m sorry to hear that. Perhaps try searching/posting your error on stackoverflow?
Hi Jason,
I got:
scipy: 1.0.0
numpy: 1.14.0
matplotlib: 2.1.2
pandas: 0.22.0
statsmodels: 0.8.0
sklearn: 0.19.1
Thanx,
Gerard
Well done!
theano: 1.0.1
Using Theano backend.
keras: 2.1.4
Well done.
scipy: 1.0.0
numpy: 1.14.0
matplotlib: 2.1.2
pandas: 0.22.0
statsmodels: 0.8.0
sklearn: 0.19.1
Well done!
theano: 1.0.1
C:\XXXXX\Anaconda3\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from
float
tonp.floating
is deprecated. In future, it will be treated asnp.float64 == np.dtype(float).type
.from ._conv import register_converters as _register_converters
tensorflow: 1.4.0
Using TensorFlow backend.
keras: 2.1.4
Nice one!
In the step last step I was facing an issue “RuntimeError: To use MKL 2018 with Theano you MUST set “MKL_THREADING_LAYER=GNU” in your environement.”. Installing mkl solved it for me.
e.g:
“conda install mkl=2017”
Thanks for the tip!
Thanks for your newbie help.
python versions.py
scipy: 0.19.1
numpy: 1.13.3
matplotlib: 2.1.2
pandas: 0.22.0
statsmodels: 0.8.0
sklearn: 0.19.0
python deep_versions.py
theano: 1.0.1
RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb
ImportError: numpy.core.multiarray failed to import
ImportError: numpy.core.umath failed to import
ImportError: numpy.core.umath failed to import
2018-03-02 13:51:23.044692: F tensorflow/python/lib/core/bfloat16.cc:664] Check failed: PyBfloat16_Type.tp_base != nullptr
Aborted (core dumped)
This is after i installed mkl=2017.
Any ideas?
Ouch. TensorFlow looks broken. Perhaps forget TensorFlow and use Keras with Theano?
I face the Same Problem, any solutions found ? please share.
Hi Jason, I did follow your guide above. Everything ok except for DL part below….
Any idea on it ?
Pls let me know your thoughts on it. Thanks in advance !!!
****************************************************************************************
python deep_versions.py
Traceback (most recent call last):
File “/home/shw04r/anaconda3/lib/python3.6/configparser.py”, line 1138, in _unify_values
sectiondict = self._sections[section]
KeyError: ‘blas’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/home/shw04r/anaconda3/lib/python3.6/site-packages/theano/configparser.py”, line 168, in fetch_val_for_key
return theano_cfg.get(section, option)
File “/home/shw04r/anaconda3/lib/python3.6/configparser.py”, line 781, in get
d = self._unify_values(section, vars)
File “/home/shw04r/anaconda3/lib/python3.6/configparser.py”, line 1141, in _unify_values
raise NoSectionError(section)
configparser.NoSectionError: No section: ‘blas’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/home/shw04r/anaconda3/lib/python3.6/site-packages/theano/configparser.py”, line 328, in __get__
delete_key=delete_key)
File “/home/shw04r/anaconda3/lib/python3.6/site-packages/theano/configparser.py”, line 172, in fetch_val_for_key
raise KeyError(key)
KeyError: ‘blas.ldflags’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “deep_versions.py”, line 2, in
import theano
File “/home/shw04r/anaconda3/lib/python3.6/site-packages/theano/__init__.py”, line 124, in
from theano.scan_module import (scan, map, reduce, foldl, foldr, clone,
File “/home/shw04r/anaconda3/lib/python3.6/site-packages/theano/scan_module/__init__.py”, line 41, in
from theano.scan_module import scan_opt
File “/home/shw04r/anaconda3/lib/python3.6/site-packages/theano/scan_module/scan_opt.py”, line 60, in
from theano import tensor, scalar
File “/home/shw04r/anaconda3/lib/python3.6/site-packages/theano/tensor/__init__.py”, line 17, in
from theano.tensor import blas
File “/home/shw04r/anaconda3/lib/python3.6/site-packages/theano/tensor/blas.py”, line 155, in
from theano.tensor.blas_headers import blas_header_text
File “/home/shw04r/anaconda3/lib/python3.6/site-packages/theano/tensor/blas_headers.py”, line 987, in
if not config.blas.ldflags:
File “/home/shw04r/anaconda3/lib/python3.6/site-packages/theano/configparser.py”, line 332, in __get__
val_str = self.default()
File “/home/shw04r/anaconda3/lib/python3.6/site-packages/theano/configdefaults.py”, line 1408, in default_blas_ldflags
check_mkl_openmp()
File “/home/shw04r/anaconda3/lib/python3.6/site-packages/theano/configdefaults.py”, line 1252, in check_mkl_openmp
raise RuntimeError(‘To use MKL 2018 with Theano you MUST set “MKL_THREADING_LAYER=GNU” in your environement.’)
RuntimeError: To use MKL 2018 with Theano you MUST set “MKL_THREADING_LAYER=GNU” in your environement.
Sorry, I have not seen this error, perhaps try posting your error to stackoverflow?
Please follow below steps to resolve this issue:
1. conda install mkl=2018
2. Add a New environment variable, and set name to MKL_THREADING_LAYER, and value to GNU. This then allowed to execute import theano from the python shell.
Thanks Goutam, It worked
tensorflow: 1.8.0
Using TensorFlow backend.
keras: 2.1.6
theano: 1.0.1
tensorflow: 1.8.0
keras: 2.1.6
Well done!
I got
scipy: 1.0.0
numpy: 1.13.3
matplotlib: 2.2.0
pandas: 0.22.0
Nice work!
Hi, sorry to be one of those people who is posting error messages .. but have you happened to have seen this one? I will try stack overflow too.
RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa
ImportError: numpy.core.multiarray failed to import
ImportError: numpy.core.umath failed to import
ImportError: numpy.core.umath failed to import
2018-03-13 10:41:29.474912: F tensorflow/python/lib/core/bfloat16.cc:664] Check failed: PyBfloat16_Type.tp_base != nullptr
Abort trap: 6
Never mind! Fixed!
Glad to hear it.
Oh dear. Does not look good. I have not seen this, but perhaps try Theano instead of TensorFlow?
theano: 1.0.1
tensorflow: 1.5.0
Traceback (most recent call last):
File “deep_versions.py”, line 8, in
import keras
ModuleNotFoundError: No module named ‘keras’
I have installed Keras by pip and conda. it is installed at envs/base, but cannot solve the problem.
Perhaps try a reboot?
File “C:\Users\HCARVALH\AppData\Local\Continuum\anaconda3\lib\site-packages\pip\index.py”, line 731, in __init__
namespaceHTMLElements=False,
TypeError: parse() got an unexpected keyword argument ‘transport_encoding’
You are using pip version 9.0.1, however version 9.0.2 is available.
You should consider upgrading via the ‘python -m pip install –upgrade pip’ command.
I could not install Keras by pip and I installed by conda at …envs/base but the script didn’t find it
Perhaps try via conda?
Simple…Awesome…
Thanks.
good evening sir ! I started Installing Anaconda today ,but I got a pop up “ANACONDA FAILED TO CREATE MENUS”
Please help me to resolve this issue sir.
Sorry, I have not seen this error. Perhaps post on stackoverflow?
(base) C:\WINDOWS\system32>python deep_version.py
theano: 1.0.1
C:\Users\ggiri\AppData\Local\Continuum\anaconda3\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from
float
tonp.floating
is deprecated. In future, it will be treated asnp.float64 == np.dtype(float).type
.from ._conv import register_converters as _register_converters
tensorflow: 1.5.0
Using TensorFlow backend.
keras: 2.1.5
Well done!
You can ignore the warning for now.
Theano Runtime Error – console output below:
>>> import tensorflow
C:\ProgramData\Anaconda3\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from
float
tonp.floating
is deprecated. In future, it will be treated asnp.float64 == np.dtype(float).type
.from ._conv import register_converters as _register_converters
>>> print(tensorflow.__version__
… )
1.5.0
>>> print(theano.__version__
… )
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘theano’ is not defined
>>> import keras
Using TensorFlow backend.
>>> print(keras.__version__)
2.1.5
>>> import theano
Traceback (most recent call last):
File “C:\ProgramData\Anaconda3\lib\configparser.py”, line 1138, in _unify_values
sectiondict = self._sections[section]
KeyError: ‘blas’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\configparser.py”, line 168, in fetch_val_for_key
return theano_cfg.get(section, option)
File “C:\ProgramData\Anaconda3\lib\configparser.py”, line 781, in get
d = self._unify_values(section, vars)
File “C:\ProgramData\Anaconda3\lib\configparser.py”, line 1141, in _unify_values
raise NoSectionError(section)
configparser.NoSectionError: No section: ‘blas’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\configparser.py”, line 328, in __get__
delete_key=delete_key)
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\configparser.py”, line 172, in fetch_val_for_key
raise KeyError(key)
KeyError: ‘blas.ldflags’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “”, line 1, in
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\__init__.py”, line 124, in
from theano.scan_module import (scan, map, reduce, foldl, foldr, clone,
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\scan_module\__init__.py”, line 41, in
from theano.scan_module import scan_opt
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\scan_module\scan_opt.py”, line 60, in
from theano import tensor, scalar
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\tensor\__init__.py”, line 17, in
from theano.tensor import blas
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\tensor\blas.py”, line 155, in
from theano.tensor.blas_headers import blas_header_text
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\tensor\blas_headers.py”, line 987, in
if not config.blas.ldflags:
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\configparser.py”, line 332, in __get__
val_str = self.default()
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\configdefaults.py”, line 1430, in default_blas_ldflags
check_mkl_openmp()
File “C:\ProgramData\Anaconda3\lib\site-packages\theano\configdefaults.py”, line 1252, in check_mkl_openmp
raise RuntimeError(‘To use MKL 2018 with Theano you MUST set “MKL_THREADING_LAYER=GNU” in your environement.’)
RuntimeError: To use MKL 2018 with Theano you MUST set “MKL_THREADING_LAYER=GNU” in your environement.
>>>
Perhaps just use TensorFlow instead?
scipy: 1.0.0
numpy: 1.14.0
matplotlib: 2.1.2
pandas: 0.22.0
statsmodels: 0.8.0
sklearn: 0.19.1
Well done!
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
– thean
Current channels:
– https://repo.anaconda.com/pkgs/main/win-64
– https://repo.anaconda.com/pkgs/main/noarch
– https://repo.anaconda.com/pkgs/free/win-64
– https://repo.anaconda.com/pkgs/free/noarch
– https://repo.anaconda.com/pkgs/r/win-64
– https://repo.anaconda.com/pkgs/r/noarch
– https://repo.anaconda.com/pkgs/pro/win-64
– https://repo.anaconda.com/pkgs/pro/noarch
– https://repo.anaconda.com/pkgs/msys2/win-64
– https://repo.anaconda.com/pkgs/msys2/noarch
Sorry to hear that.
(base) C:\Users\vishu>cd code
(base) C:\Users\vishu\code>python deep-versions.py
Traceback (most recent call last):
File “C:\Users\vishu\Anaconda3\lib\configparser.py”, line 1138, in _unify_values
sectiondict = self._sections[section]
KeyError: ‘blas’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\Users\vishu\Anaconda3\lib\site-packages\theano\configparser.py”, line 168, in fetch_val_for_key
return theano_cfg.get(section, option)
File “C:\Users\vishu\Anaconda3\lib\configparser.py”, line 781, in get
d = self._unify_values(section, vars)
File “C:\Users\vishu\Anaconda3\lib\configparser.py”, line 1141, in _unify_values
raise NoSectionError(section)
configparser.NoSectionError: No section: ‘blas’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\Users\vishu\Anaconda3\lib\site-packages\theano\configparser.py”, line 328, in __get__
delete_key=delete_key)
File “C:\Users\vishu\Anaconda3\lib\site-packages\theano\configparser.py”, line 172, in fetch_val_for_key
raise KeyError(key)
KeyError: ‘blas.ldflags’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “deep-versions.py”, line 2, in
import theano
File “C:\Users\vishu\Anaconda3\lib\site-packages\theano\__init__.py”, line 124, in
from theano.scan_module import (scan, map, reduce, foldl, foldr, clone,
File “C:\Users\vishu\Anaconda3\lib\site-packages\theano\scan_module\__init__.py”, line 41, in
from theano.scan_module import scan_opt
File “C:\Users\vishu\Anaconda3\lib\site-packages\theano\scan_module\scan_opt.py”, line 60, in
from theano import tensor, scalar
File “C:\Users\vishu\Anaconda3\lib\site-packages\theano\tensor\__init__.py”, line 17, in
from theano.tensor import blas
File “C:\Users\vishu\Anaconda3\lib\site-packages\theano\tensor\blas.py”, line 155, in
from theano.tensor.blas_headers import blas_header_text
File “C:\Users\vishu\Anaconda3\lib\site-packages\theano\tensor\blas_headers.py”, line 987, in
if not config.blas.ldflags:
File “C:\Users\vishu\Anaconda3\lib\site-packages\theano\configparser.py”, line 332, in __get__
val_str = self.default()
File “C:\Users\vishu\Anaconda3\lib\site-packages\theano\configdefaults.py”, line 1430, in default_blas_ldflags
check_mkl_openmp()
File “C:\Users\vishu\Anaconda3\lib\site-packages\theano\configdefaults.py”, line 1252, in check_mkl_openmp
raise RuntimeError(‘To use MKL 2018 with Theano you MUST set “MKL_THREADING_LAYER=GNU” in your environement.’)
RuntimeError: To use MKL 2018 with Theano you MUST set “MKL_THREADING_LAYER=GNU” in your environement.
Perhaps try setting the variable as suggestion in the error?
theano: 0.9.0.dev-unknown-git
tensorflow: 1.7.0
keras: 2.1.5
Well done!
I got this when checking deep_versions.py
WARNING (theano.tensor.blas): Using Numpy C-API based implementation for BLAS functions.
theano : 1.0.1
what this mean?
I don’t know sorry. Perhaps try searching/posting on stackoverflow.
Sir I am unable to update scikit learn library I tried as you instructed but it shows syntax error please resolve
Thanks in anticipation
I’m sorry to hear that, perhaps try posting on stackoverflow? I am not an expert at debugging workstations.
I got this versions after installation:
scipy: 1.0.0
numpy: 1.14.0
matplotlib: 2.1.2
pandas: 0.22.0
statsmodels: 0.8.0
sklearn: 0.19.1
Well done!
can i inatall tensorflow with win7 32 bit
I don’t know sorry. Perhaps try? Perhaps search or post stackoverflow?
Thank you so much, Sir! Here are what I’ve got.
scipy: 1.0.0
numpy: 1.14.0
matplotlib: 2.1.2
pandas: 0.22.0
statsmodels: 0.8.0
sklearn: 0.19.1
tensorflow: 1.5.0
Using TensorFlow backend.
keras: 2.1.5
Well done!
import is not recognised as internal or external command
The code must be saved into a file with a .py extension and run as follows: