TensorFlow: Difference between revisions

130 bytes removed ,  28 January 2021
Line 20: Line 20:


===Install TF1===
===Install TF1===
See [https://www.tensorflow.org/install/source#linux https://www.tensorflow.org/install/source#linux] for a list of compatible Cuda and Cudnn versions.
Just install using Conda. It's the easiest way.


<pre>
<pre>
# Install compatible cuda and cudnn versions.
conda install tensorflow-gpu=1.15
conda install cudatoolkit=10.0.130 cudnn=7.6.5
 
# Install tensorflow
pip install tensorflow-gpu==1.15
 
# Test GPU support
python -c "import tensorflow as tf;print(tf.test.is_gpu_available())"
</pre>
</pre>


;Notes
;Notes
* Conda will automatically install a compatible cuda and cudnn into the cuda environment. Your host OS only needs to have a sufficiently new version of nvidia drivers installed.
* Sometimes, I get <code>CUDNN_STATUS_INTERNAL_ERROR</code>. This is fixed by setting the environment variable <code>TF_FORCE_GPU_ALLOW_GROWTH=true</code> in my conda env. See [https://stackoverflow.com/questions/46826497/conda-set-ld-library-path-for-env-only Add env variables to conda env]
* Sometimes, I get <code>CUDNN_STATUS_INTERNAL_ERROR</code>. This is fixed by setting the environment variable <code>TF_FORCE_GPU_ALLOW_GROWTH=true</code> in my conda env. See [https://stackoverflow.com/questions/46826497/conda-set-ld-library-path-for-env-only Add env variables to conda env]