Uploaded by Drive A kamaruldrive1

Installing TensorFlow

advertisement
Installing TensorFlow
TensorFlow 2 packages are available1

tensorflow —Latest stable release with CPU and GPU support (Ubuntu and
Windows)

tf-nightly —Preview build (unstable). Ubuntu and Windows include GPU
support.
Older versions of TensorFlow1
For TensorFlow 1.x, CPU and GPU packages are separate:

tensorflow==1.15 —Release for CPU-only

tensorflow-gpu==1.15 —Release with GPU support (Ubuntu and Windows)
System Requirements1:







Python 3.5–3.8
 Python 3.8 support requires TensorFlow 2.2 or later.
pip 19.0 or later (requires manylinux2010 support)
Ubuntu 16.04 or later (64-bit)
macOS 10.12.6 (Sierra) or later (64-bit) (no GPU support)
Windows 7 or later (64-bit)
 Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and
2019
Raspbian 9.0 or later
GPU support requires a CUDA®-enabled card (Ubuntu and Windows)
Hardware Requirements:


1
Starting with TensorFlow 1.6, binaries use AVX instructions which may not run
on older CPUs.
Read the GPU support guide to set up a CUDA®-enabled GPU card on Ubuntu
or Windows.
https://www.tensorflow.org/install/pip#virtual-environment-install
Installation Steps:
Step 1: Download and install Microsoft Visual C++ Redistributable for Visual Studio
2015, 2017 and 2019 2
Step 2: Run CMD as Admin, create environment in conda and TensorFlow installations1
3:
conda create –name DeepIDS
activate DeepIDS
conda install python=3.7.0
pip install --upgrade pip
pip install tensorflow==1.15.0
pip install keras
Errors and Troubleshooting:
Error message: error: Failed to load the native TensorFlow runtime
Solution: Install or Update Microsoft Visual C++ Redistributable for Visual Studio 2015,
2017 and 2019 4 5 6
If TensorFlow 1.8 is needed:
https://github.com/tensorflow/tensorflow/issues/20444
Tutorials:
https://www.tensorflow.org/tutorials
https://medium.com/@sometimescasey/building-tensorflow-from-source-for-sse-avxfma-instructions-worth-the-effort-fbda4e30eec3
2
https://support.microsoft.com/help/2977003/the-latest-supported-visual-c-downloads
https://medium.com/@margaretmz/anaconda-jupyter-notebook-tensorflow-and-keras-b91f381405f8
4 https://stackoverflow.com/questions/44623184/error-failed-to-load-the-native-tensorflowruntime/52496723
5 https://github.com/tensorflow/tensorflow/issues/35749
6 https://github.com/tensorflow/tensorflow/issues/39007
3
Download