Tensorflow 不使用 GPU(根据 TensorBoard)
Tensorflow not using GPU (according to TensorBoard)
编辑:GTX 1070,ubuntu16.04,git哈希:
3b75eb34ea2c4982fb80843be089f02d430faade
我正在根据自己的数据重新训练 inception 模型。一切都很好,直到最后一个命令:
bazel-bin/inception/flowers_train \
--config=cuda \
--train_dir="${TRAIN_DIR}" \
--data_dir="${OUTPUT_DIRECTORY}" \
--pretrained_model_checkpoint_path="${MODEL_PATH}" \
--fine_tune=True \
--initial_learning_rate=0.001 \
--input_queue_memory_factor=1
根据日志,Tensorflow 似乎正在使用 GPU :
I tensorflow/core/common_runtime/gpu/gpu_device.cc:951] Found device 0 with properties:
name: GeForce GTX 1070
major: 6 minor: 1 memoryClockRate (GHz) 1.7715
pciBusID 0000:03:00.0
Total memory: 7.92GiB
Free memory: 7.77GiB
I tensorflow/core/common_runtime/gpu/gpu_device.cc:972] DMA: 0
I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] 0: Y
I tensorflow/core/common_runtime/gpu/gpu_device.cc:1041] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 1070, pci bus id: 0000:03:00.0)
但是当我检查 TensorBoard 中的学习时,网络主要使用 CPU(蓝色/设备:CPU:0,绿色/设备:GPU:0):
TensorBoard 图:
我试过这两个 TensorFlow 设置:
使用 nvidia-367 驱动、CUDA8 8.0、cuDNN 从源安装
v5,来自大师的源代码(16/10/06 - r11?)。为 GPU 编译
使用:
bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer
bazel-bin/tensorflow/cc/tutorials_example_trainer --use_gpu
bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
docker Tensorflow 在装有 GTX 的 PC 上的 GPU 图像
1070 8Go
nvidia-docker run -it -p 8888:8888 -p 6006:6006 gcr.io/tensorflow/tensorflow:latest-gpu /bin/bash
有什么帮助吗?
根据 this issue ,开始 'tower' 是执行大部分工作的地方。所以看起来基本上没问题。
除了还有点奇怪。
运行 watch nvidia-smi
给出:
2016 年 10 月 10 日星期一10:31:04
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 367.48 Driver Version: 367.48 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 1070 Off | 0000:03:00.0 On | N/A |
| 29% 57C P2 41W / 230W | 7806MiB / 8113MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1082 G /usr/lib/xorg/Xorg 69MiB |
| 0 3082 C /usr/bin/python 7729MiB |
+-----------------------------------------------------------------------------+
虽然顶部给出:
PID UTIL. PR NI VIRT RES SHR S %CPU %MEM TEMPS+ COM.
3082 root 20 0 26,739g 3,469g 1,657g S 101,3 59,7 7254:50 python
GPU好像被忽略了...
编辑:GTX 1070,ubuntu16.04,git哈希: 3b75eb34ea2c4982fb80843be089f02d430faade
我正在根据自己的数据重新训练 inception 模型。一切都很好,直到最后一个命令:
bazel-bin/inception/flowers_train \
--config=cuda \
--train_dir="${TRAIN_DIR}" \
--data_dir="${OUTPUT_DIRECTORY}" \
--pretrained_model_checkpoint_path="${MODEL_PATH}" \
--fine_tune=True \
--initial_learning_rate=0.001 \
--input_queue_memory_factor=1
根据日志,Tensorflow 似乎正在使用 GPU :
I tensorflow/core/common_runtime/gpu/gpu_device.cc:951] Found device 0 with properties:
name: GeForce GTX 1070
major: 6 minor: 1 memoryClockRate (GHz) 1.7715
pciBusID 0000:03:00.0
Total memory: 7.92GiB
Free memory: 7.77GiB
I tensorflow/core/common_runtime/gpu/gpu_device.cc:972] DMA: 0
I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] 0: Y
I tensorflow/core/common_runtime/gpu/gpu_device.cc:1041] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 1070, pci bus id: 0000:03:00.0)
但是当我检查 TensorBoard 中的学习时,网络主要使用 CPU(蓝色/设备:CPU:0,绿色/设备:GPU:0):
TensorBoard 图:
我试过这两个 TensorFlow 设置:
使用 nvidia-367 驱动、CUDA8 8.0、cuDNN 从源安装 v5,来自大师的源代码(16/10/06 - r11?)。为 GPU 编译 使用:
bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer bazel-bin/tensorflow/cc/tutorials_example_trainer --use_gpu bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
docker Tensorflow 在装有 GTX 的 PC 上的 GPU 图像 1070 8Go
nvidia-docker run -it -p 8888:8888 -p 6006:6006 gcr.io/tensorflow/tensorflow:latest-gpu /bin/bash
有什么帮助吗?
根据 this issue ,开始 'tower' 是执行大部分工作的地方。所以看起来基本上没问题。
除了还有点奇怪。
运行 watch nvidia-smi
给出:
2016 年 10 月 10 日星期一10:31:04
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 367.48 Driver Version: 367.48 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 1070 Off | 0000:03:00.0 On | N/A |
| 29% 57C P2 41W / 230W | 7806MiB / 8113MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1082 G /usr/lib/xorg/Xorg 69MiB |
| 0 3082 C /usr/bin/python 7729MiB |
+-----------------------------------------------------------------------------+
虽然顶部给出:
PID UTIL. PR NI VIRT RES SHR S %CPU %MEM TEMPS+ COM.
3082 root 20 0 26,739g 3,469g 1,657g S 101,3 59,7 7254:50 python
GPU好像被忽略了...