1. RuntimeError: /job:localhost/replica:0/task:0/device:GPU:0 unknown device.
[WARNING] Some requested devices in `tf.distribute.Strategy` are not visible to TensorFlow: /job:localhost/replica:0/task:0/device:GPU:0
....
python3.6/site-packages/tensorflow_core/python/framework/constant_op.py", line 96, in convert_to_eager_tensor
return ops.EagerTensor(value, ctx.device_name, dtype)
RuntimeError: /job:localhost/replica:0/task:0/device:GPU:0 unknown device.
训练脚本里指定了使用GPU 0,但是报错了,仔细查看发现安装Tensorflow时未指定GPU版本,因此修改一下安装命令即可:
# 原来安装TF命令:
$ pip install tensorflow # 默认安装cpu版本
# 修改后:
$ pip install tensorflow-gpu # 指定安装GPU版本
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting tensorflow-gpu
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/25/44/47f0722aea081697143fbcf5d2aa60d1aee4aaacb5869aee2b568974777b/tensorflow_gpu-2.0.0-cp36-cp36m-manylinux2010_x86_64.whl (380.8MB)
|███▉ | 45.9MB 263kB/s eta 0:21:09