01.10.2019
Posted by 

In case you missed it, is now, as well as Mac and Linux. For most of TensorFlow’s first year of existence, the only means of Windows support was virtualization,. Even without GPU support, this is great news for me.

という訳で、Mac で C# をインターフェースとして TensorFlow を触ってみた記事です。. TensorFlowSharp のページでは 1.1.0 を直接ダウンロードする様に書かれていて、普通にこの方法でインストールしてもいいのですが. Grep tensor -r-xr-xr-x 1 root wheel 94218652 1 1 1970.

I teach a and dealing with students who only run Windows was always difficult. Previously, I encouraged Windows students to either use Docker. Now all will be able to run locally. Using your GPU for deep learning is widely reported as highly effective. Clearly very high end GPU clusters can do some amazing things with deep learning.

However, I was curious what deep learning could offer a high-end GPU that you might find on a laptop. Particularly, I was curious about my Windows Surface Book (GPU: GeForce GT 940) performance of using the GPU vs the CPU. Should I be using the GPU for my deep learning research?

It turns out that I should be! For a simple example (see my ), I got the following results: 1 2 CPU Version of TensorFlow: 1 hour, 54 minutes. GPU Version of TensorFlow: 13 minutes. The newer Surface Book’s have even more advanced GPU’s (GeForce GT 965). The TensorFlow playing field has really changed between Mac and Windows in the last year.

When TensorFlow was first released (November 2015) there was no Windows version and I could get decent performance on my Mac Book Pro (GPU: NVidia 650M). Now, on the first day of 2017, the new Mac Book Pros are sporting a strange LCD touch bar (to replace function keys) and an AMD GPU. Both of which are useless to TensorFlow. At some point TensorFlow will probably add OpenCL support, and allow AMD chips to run. But, for now, NVidia CUDA is where most of the interesting developments are being made for deep learning. I never thought I would say this a year ago, but the Microsoft Surface Book, is one of the best mainstream laptops for deep learning development. Of course, if you are willing to go outside the mainstream, there are more.

Though, if you need extreme heavy lifting with GPU’s you should. Installing First, you should make sure you have the correct NVidia drivers installed:. CUDA for Deep Neural Networks Installing TensorFlow into Windows Python is a simple pip command. As of the writing of this post, TensorFlow requires Python 2.7, 3.4 or 3.5. In my case I used Anaconda Python 3.5.

The first thing that I did was create CPU and GPU environment for TensorFlow. This keeps them separate from other non-deep learning Python environments that I have. To create my CPU TensorFlow environment, I used: 1 2 3 4 5 conda create -name tensorflow python=3.5 activate tensorflow conda install jupyter conda install scipy pip install tensorflow To create my GPU TensorFlow environment, I used: 1 2 3 4 5 conda create -name tensorflow-gpu python=3.5 activate tensorflow-gpu conda install jupyter conda install scipy pip install tensorflow-gpu Your TensorFlow code will not change using a single GPU.

You can simply run the same code by switching environments. TensorFlow will either use the GPU or not, depending on which environment you are in. You can switch between environments with: 1 2 activate tensorflow activate tensorflow-gpu Conclusions If you are doing moderate deep learning networks and data sets on your local computer you should probably be using your GPU. Even if you are using a laptop.

NVidia is the GPU of choice for scientific computing. While AMD might be fully capable, support for AMD is much more sparse.

Mac

Tweet Share Share Google Plus 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. Update Mar/2017: Added note that you only need one of Theano or TensorFlow to use Kears 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. Click “Anaconda” from the menu and click “Download” to go to the. 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. Install the Theano deep learning library by typing. I got the following warning when I tried to see deep versions python deepversions.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. I have installed theano and tensorflow, while the errors pop out when installing keras.

The output looks OK for versions.py, shown as follows C: Users stevenwsy Desktop Steven – Pythonpython 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 deepversions.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 – Pythonpython deepversions.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.

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: and 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.

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: Temppython 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: Temppython deepversions.py theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291 Traceback (most recent call last): File “deepversions.py”, line 5, in import tensorflow ModuleNotFoundError: No module named ‘tensorflow’ In the ‘deepversions.py’ script I swappped the order of the ‘keras’ and ‘tensorflow’ check. C: Temppython deepversions.py theano: 0.9.0.dev-c697eeab84e5b8a74908da654b66ec9eca4f1291 Using TensorFlow backend. Traceback (most recent call last): File “deepversions.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.tensorflowbackend import. File “C: ProgramData Anaconda3 lib site-packages keras backend tensorflowback end.py”, line 1, in import tensorflow as tf ModuleNotFoundError: No module named ‘tensorflow’.

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:82: W tensorflow/core/platform/cpufeatureguard.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:04: W tensorflow/core/platform/cpufeatureguard.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:08: W tensorflow/core/platform/cpufeatureguard.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:14: W tensorflow/core/platform/cpufeatureguard.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:17: W tensorflow/core/platform/cpufeatureguard.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. Hi I’m getting the following: python deepversion.py Could not find platform independent libraries Could not find platform dependent libraries Consider setting $PYTHONHOME to : Fatal Python error: PyInitialize: 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 conflictthanks!

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. Microsoft Windows Version 10.0.15063 (c) 2017 Microsoft Corporation. All rights reserved.

C: Users FOLASADE ARIYIKEconda -V conda 4.3.22 C: Users FOLASADE ARIYIKEpython -V Python 3.6.1:: Anaconda 4.4.0 (64-bit) C: Users FOLASADE ARIYIKEconda 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 ARIYIKEconda 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 np112py360 C: Users FOLASADE ARIYIKE. 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.

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 “deepversions.py”, line 4, in import tensorflow ModuleNotFoundError: No module named ‘tensorflow’. 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 “deepversions.py”, line 4, in import tensorflow ModuleNotFoundError: No module named ‘tensorflow’.

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. I created a conda ‘tensorflow’ environment with python 3.5. With command 『pip install –ignore-installed –upgrade I got ERROR saying 『tensorflow-1.2.1-cp35-cp35m-winamd64.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』.

1.1,

It ouput the directory of my python. Then checked if it’s already put under the path inside the environmental variable.

I’ve been stuck for dayssss and actually postponed my projects for months because of this. Please help it means a LOT o(╯□╰)o.

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). 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. 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. Thank for your tutorials! 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).

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 deepversions.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:. 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! Thanks Jason for such an awesome post! I have installed the tools successfully but while importing keras, it is searching for tensorflow.

Tf 1.0 1.1 With Fma And Friends For Machine

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 convutils File “C: Users AppData Local Continuum anaconda3 lib site-packages keras utils convutils.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.tensorflowbackend import. File “C: Users AppData Local Continuum anaconda3 lib site-packages keras backend tensorflowbackend.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. Jason I met an issue while installing theano.

Please look at the code below. What should I do?

C: ProgramData Anaconda3) C: Users Pankaj Labconda install theano Fetching package metadata. Solving package specifications:. 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 – PCcd.

(C: Users NAZEK – PC Anaconda3) C: Userscd. 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 irWindows-7-6.1.7601-SP1-Intel64Family6Model60Stepping3GenuineIntel-2.7.

14-64 lazylinkerext mod.cpp:744:33: error: ‘struct CLazyLinker’ has no member n amed ‘nodeninputs’. For (int i = 0; i nodeninputsowneridx; Any suggestions on how to tackle this issue?

Tf 1.0 1.1 With Fma And Friends For Mac Torrent

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.fasttensorutil’ does not match runtime version 3.6 return f(.args,.kwds) tensorflow: 1.4.1 Using TensorFlow backend. Keras: 2.1.2. 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. 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.

Tf 1.0 1.1 With Fma And Friends For Mac

Click on “Environment Variables” 3. Click on “New”. In “Variable name” fill in “MKLTHREADINGLAYER”.

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. 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.

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.”? 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 “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.