Tensorflow-gpu在CPU上运行,但我没有安装cpu版本

时间:2018-02-24 14:40:41

标签: python tensorflow

我试图了解NN,并在张量流后端使用keras。现在我的张量流版本是GPU版本。但是当我看着任务管理器时,我注意到我的CPU运行在100%而GPU没有被使用。另外我没有为cpu安装任何tensorflow。 导入tensorflow时,我得到以下结果:

>>> import tensorflow as tf
C:\Users\mridu\AppData\Local\Programs\Python\Python36\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters

另外,如果我跑:

>>> from tensorflow.python.client import device_lib
>>> print(device_lib.list_local_devices())

我得到以下输出:

2018-02-24 20:01:19.640381: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
2018-02-24 20:01:20.245834: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:1105] Found device 0 with properties:
name: GeForce 940MX major: 5 minor: 0 memoryClockRate(GHz): 1.189
pciBusID: 0000:01:00.0
totalMemory: 4.00GiB freeMemory: 3.35GiB
2018-02-24 20:01:20.253903: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:1195] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: GeForce 940MX, pci bus id: 0000:01:00.0, compute capability: 5.0)
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 16468572883557283825
, name: "/device:GPU:0"
device_type: "GPU"
memory_limit: 3240964915
locality {
  bus_id: 1
}
incarnation: 10646606003076945092
physical_device_desc: "device: 0, name: GeForce 940MX, pci bus id: 0000:01:00.0, compute capability: 5.0"
]

此外,我已附加pip list输出:

absl-py (0.1.10)
bleach (1.5.0)
certifi (2017.11.5)
chardet (3.0.4)
cycler (0.10.0)
enum34 (1.1.6)
futures (3.1.1)
h5py (2.7.1)
html5lib (0.9999999)
idna (2.6)
Keras (2.1.4)
Markdown (2.6.11)
matplotlib (2.1.2)
numpy (1.14.0)
opencv-contrib-python (3.4.0.12)
opencv-python (3.4.0.12)
pandas (0.22.0)
Pillow (5.0.0)
pip (9.0.1)
protobuf (3.5.1)
pygame (1.9.3)
pyparsing (2.2.0)
python-dateutil (2.6.1)
pytz (2017.3)
PyYAML (3.12)
requests (2.18.4)
scikit-learn (0.19.1)
scipy (1.0.0)
setuptools (38.5.1)
six (1.11.0)
sklearn (0.0)
tensorflow-gpu (1.5.0)
tensorflow-tensorboard (1.5.0)
urllib3 (1.22)
Werkzeug (0.14.1)
wheel (0.30.0)

任何帮助将不胜感激!

0 个答案:

没有答案