【发布时间】:2018-09-20 13:37:31
【问题描述】:
我正在创建一个 conda 环境,仅用于使用来自 conda-forge 频道的 tensorflow-gpu 包
conda create -n tst -c conda-forge tensorflow-gpu
这导致tensorflow-gpu 和 tensorflow 软件包都被安装:
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
...
然后当我导入 tensorflow 时,它看不到 GPU:
>>> 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
问题:
- 为什么 conda 只需要
tensorflow-gpu和tensorflow软件包时同时安装前者? - 两个包能否和平共存,如果可以,如何在两者之间切换?
- 加分项:为什么从主频道(即
conda create -n tst tensorflow-gpu)安装时一切正常? (我没有根据的猜测是,在conda-forge中,tensorflow-gpu包实际上来自主通道,因此在导入期间具有较低的优先级。
【问题讨论】:
-
我不能告诉你为什么,但我可以确认这发生在我身上,因为我也是从
conda-forge频道安装的。阅读这个问题帮助我解决了我的 tensorflow-gpu 问题,非常感谢 :) 并为你点赞!
标签: python tensorflow conda