Installing TensorFlow, Keras, and Python in Windows
[ad_1]
Updated version: https://www.youtube.com/watch?v=PnK1jO2kXOQ
You can find the instructions here (from the video): https://github.com/jeffheaton/t81_558_deep_learning/blob/master/manual_setup.ipynb
Please subscribe and comment!
Follow me:
YouTube: https://www.youtube.com/user/HeatonResearch
Twitter: https://twitter.com/jeffheaton
GitHub: https://github.com/jeffheaton
Source
[ad_2]
I created a new version of this for TensorFlow 2.x, GPU and CPU. https://www.youtube.com/watch?v=PnK1jO2kXOQ
Does it supports AVX instructions?
If not, then could you please upload a video on how to to build tensorflow to support AVX instructions.
not in the class but this was extremely useful thank you
It was a great help. Thanks.
thanks so much!!
hi sir, please answer me if i make a mistake in the sequence of installing function how can i delete and start from beginning?
at the time of installation, all seems good but when i import tenserflow on jupyter notebook its showing error
—————————————————————————
ImportError Traceback (most recent call last)
~Anaconda3libsite-packagestensorflowpythonpywrap_tensorflow.py in <module>
57
—> 58 from tensorflow.python.pywrap_tensorflow_internal import *
59 from tensorflow.python.pywrap_tensorflow_internal import _version_
~Anaconda3libsite-packagestensorflowpythonpywrap_tensorflow_internal.py in <module>
27 return _mod
—> 28 _pywrap_tensorflow_internal = swig_import_helper()
29 del swig_import_helper
~Anaconda3libsite-packagestensorflowpythonpywrap_tensorflow_internal.py in swig_import_helper()
23 try:
—> 24 _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
25 finally:
~Anaconda3libimp.py in load_module(name, file, filename, details)
241 else:
–> 242 return load_dynamic(name, filename, file)
243 elif type_ == PKG_DIRECTORY:
~Anaconda3libimp.py in load_dynamic(name, path, file)
341 name=name, loader=loader, origin=path)
–> 342 return _load(spec)
343
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
<ipython-input-8-64156d691fe5> in <module>
—-> 1 import tensorflow as tf
~Anaconda3libsite-packagestensorflow__init__.py in <module>
22
23 # pylint: disable=g-bad-import-order
—> 24 from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
25
26 from tensorflow._api.v1 import app
~Anaconda3libsite-packagestensorflowpython__init__.py in <module>
47 import numpy as np
48
—> 49 from tensorflow.python import pywrap_tensorflow
50
51 # Protocol buffers
~Anaconda3libsite-packagestensorflowpythonpywrap_tensorflow.py in <module>
72 for some common reasons and solutions. Include the entire stack trace
73 above this error message when asking for help.""" % traceback.format_exc()
—> 74 raise ImportError(msg)
75
76 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long
ImportError: Traceback (most recent call last):
File "C:UsersWindows 10 ProAnaconda3libsite-packagestensorflowpythonpywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:UsersWindows 10 ProAnaconda3libsite-packagestensorflowpythonpywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:UsersWindows 10 ProAnaconda3libsite-packagestensorflowpythonpywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:UsersWindows 10 ProAnaconda3libimp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:UsersWindows 10 ProAnaconda3libimp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
what should i do, please help me
NOTE: i used "pip install tensorflow" instead of "pip install tensorflow==1.2.1"
hlo i have installed anaconda but on anaconda prompt and also on command prompt it is showing python is not recognized..i try both the ways by checking that tricky check box and by discarding that box also..what should i do pls help
AllhamduLILLAH thankyou so much! God bless you in both worlds. Amen it helped me a lot after watching so many tutorials. Great and best one!
New updated version for 2019: https://www.youtube.com/watch?v=59duINoc8GM
Thanks for making so helpful video. I am getting this error while using Tensorflow: "Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2" in Window 10 machine
Google/Miniconda always throw me one curve ball a semester! 🙂 I believe I've found the source of an issue that many of you seem to have been
running into lately. The issue that I noticed working with a student last night is that TensorFlow does not work with Python 3.7 (currently, Jan 2019). Previously, Miniconda had 3.6 as the default download. At some point, they moved this forward to 3.6.
I tried out several install techniques and I believe the easiest method is to install Miniconda Python 3.7 and then create a 3.6 environment (inside of Miniconda 3.7) for Tensorflow. I use this technique often, when I have multiple versions that do not play nicely together. Python lets you create multiple environments that can each have completely different versions installed.
I updated module 1 to have instructions on how to do this. Refer to this link:
https://github.com/jeffheaton/t81_558_deep_learning/blob/master/t81_558_class01_intro_python.ipynb (Links to an external site.)Links to an external site.
while using (pip install sklearn) anacondaprompt is showing this
Requirement already satisfied: sklearn in d:anacondalibsite-packages (0.0)
Requirement already satisfied: scikit-learn in d:anacondalibsite-packages (from sklearn) (0.19.2)
twisted 18.7.0 requires PyHamcrest>=1.9.0, which is not installed.
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install –upgrade pip' command.)
and show statement ( File "D:ANACONDAlibrunpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "D:ANACONDAlibrunpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:ANACONDAlibsite-packagespip__main__.py", line 16, in <module>
from pip._internal import main as _main # noqa
File "D:ANACONDAlibsite-packagespip_internal__init__.py", line 5, in <module>
import logging
File "D:ANACONDAliblogging__init__.py", line 40, in <module>
import threading
File "C:UsersGOOD LUCKthreading.py", line 2, in <module>
class m(threading.Thread):
AttributeError: module 'threading' has no attribute 'Thread') after using command (python -m pip install –upgrade pip)
This is fantastic!
Why does '(base)' appear in my anaconda command prompt?
Thanks Jeff . I had been struggling with tensorflow installation for sometime now. This was easy.
For the complete installation I had to use python 3.6.7
Also it would be great if you could also guide on how to the tensorflow installation for GPU
i can't install tensorflow and every time i got this error >>> Could not find a version that satisfies the requirement tensorlow==1.2.1 (from versions: )
No matching distribution found for tensorflow==1.2.1
thank you sir
This has been so helpful and installation is clean (finally). Thank you!
Some changes I had to make as i got a whole lot of errors while installing tensorflow (even though I followed the instructions verbatim)
conda install jupyter
Once Jupyter is installed, it is started with the following command:
jupyter notebook
The following packages are needed for this course:
conda install scipy
pip install –upgrade sklearn
pip install –upgrade pandas
pip install –upgrade pandas-datareader
pip install –upgrade matplotlib
pip install –upgrade pillow
pip install –upgrade requests
pip install –upgrade h5py
—– This did NOT work: pip install –upgrade tensorflow==1.12.0
as I got this error
Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow"
—– Instead I used this: this works
conda info
conda create -n tensorenviron
activate tensorenviron
conda install tensorflow
—- after this verified with
python
>> import tensorflow as tf
—- and it worked
— and then finally installed keras using
pip install –upgrade keras==2.2.4
— hope this works for everyone
i cant install tensorflow
This was very useful in installing tensorflow and keras. Appreciate it.
github page not found 🙁
Thank you so so Good Doctor
please help to solve this problem…
>pip install tensorflow==1.2.1
Collecting tensorflow==1.2.1
Could not find a version that satisfies the requirement tensorflow==1.2.1 (from versions: )
No matching distribution found for tensorflow==1.2.1
Thanks a lot, i install all that packages in Pycharm ( i dont know why it doesnt work on spyder). Tensorflow cannot be import in spyder. 🙁 but pycharm works 🙂
nothing is working in my system there is an error
ImportError Traceback (most recent call last)
~Anaconda3libsite-packagestensorflowpythonpywrap_tensorflow.py in swig_import_helper()
17 try:
—> 18 fp, pathname, description = imp.find_module('_pywrap_tensorflow', [dirname(__file__)])
19 except ImportError:
~Anaconda3libimp.py in find_module(name, path)
296 else:
–> 297 raise ImportError(_ERR_MSG.format(name), name=name)
298
ImportError: No module named '_pywrap_tensorflow'
During handling of the above exception, another exception occurred:
ModuleNotFoundError Traceback (most recent call last)
~Anaconda3libsite-packagestensorflowpython__init__.py in <module>()
53 # use `dlopen()` for dynamic loading.
—> 54 from tensorflow.python import pywrap_tensorflow
55 except ImportError:
~Anaconda3libsite-packagestensorflowpythonpywrap_tensorflow.py in <module>()
27 return _mod
—> 28 _pywrap_tensorflow = swig_import_helper()
29 del swig_import_helper
~Anaconda3libsite-packagestensorflowpythonpywrap_tensorflow.py in swig_import_helper()
19 except ImportError:
—> 20 import _pywrap_tensorflow
21 return _pywrap_tensorflow
ModuleNotFoundError: No module named '_pywrap_tensorflow'
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
<ipython-input-2-64156d691fe5> in <module>()
—-> 1 import tensorflow as tf
~Anaconda3libsite-packagestensorflow__init__.py in <module>()
22
23 # pylint: disable=wildcard-import
—> 24 from tensorflow.python import *
25 # pylint: enable=wildcard-import
26
~Anaconda3libsite-packagestensorflowpython__init__.py in <module>()
58 please exit the tensorflow source tree, and relaunch your python interpreter
59 from there.""" % traceback.format_exc()
—> 60 raise ImportError(msg)
61
62 # Protocol buffers
ImportError: Traceback (most recent call last):
File "C:UserssohaibAnaconda3libsite-packagestensorflowpythonpywrap_tensorflow.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_pywrap_tensorflow', [dirname(__file__)])
File "C:UserssohaibAnaconda3libimp.py", line 297, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:UserssohaibAnaconda3libsite-packagestensorflowpython__init__.py", line 54, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:UserssohaibAnaconda3libsite-packagestensorflowpythonpywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "C:UserssohaibAnaconda3libsite-packagestensorflowpythonpywrap_tensorflow.py", line 20, in swig_import_helper
import _pywrap_tensorflow
ModuleNotFoundError: No module named '_pywrap_tensorflow'
Error importing tensorflow. Unless you are using bazel,
you should not try to import tensorflow from its source directory;
please exit the tensorflow source tree, and relaunch your python interpreter
from there.
Thanks for your support.
How to install pytorch in windows?
I tried to access the github link in the description but, it's showing page not found.