I am creating a conda environment solely for using the tensorflow-gpu
package from the conda-forge
channel
conda create -n tst -c conda-forge tensorflow-gpu
This results in both tensorflow-gpu
and tensorflow
packages to be installed:
The following NEW packages will be INSTALLED:
_tflow_1100_select: 0.0.1-gpu
...
tensorboard: 1.10.0-py36_0 conda-forge
tensorflow: 1.10.0-py36_0 conda-forge
tensorflow-gpu: 1.10.0-hf154084_0
...
Then when I import tensorflow, it does not see GPUs:
>>> import tensorflow as tf
>>> tf.test.is_gpu_available()
2018-09-20 15:29:21.778708: I T:\src\github\tensorflow\tensorflow\core\platform\cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
False
Questions:
tensorflow-gpu
and tensorflow
packages when only the former is required?conda create -n tst tensorflow-gpu
? (My uneducated guess is that in conda-forge
, the tensorflow-gpu
package actually comes from the main channel and thus has a lower priority during import).From looking at the lists of packages on conda-forge (https://conda-forge.org/feedstocks/), it looks like there's no tensorflow-gpu package there. There's some weird compatibility issues between conda-forge and default anaconda packages - I generally try to avoid mixing the two.
Even if you install as conda install -c anaconda tensorflow-gpu
, it pulls in the non-GPU tensorflow package at the same time, but running
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
finds the GPU. So it seems to automatically use the GPU-enabled version. If I were to want to avoid GPU usage, I'd probably wrap my training with with tf.device([CPU ID here])
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With