tensorflow 在cpu的环境中无法导入gpu训练好的模型(Make sure the device specification refers to a valid device.)
2018-04-08 18:45
2046 查看
在我准备迁移测试mobilenet时
在调用
new_saver.restore(sess, checkpoint_path_data)
出现
InvalidArgumentError: Cannot assign a device for operation 'clone_1/gradients/clone_1/MobileNet/conv_1/batch_norm/moments/sufficient_statistics/Sub_grad/BroadcastGradientArgs_5': Operation was explicitly assigned to /device:GPU:1 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0 ].
#tf.ConfigProto()的参数
log_device_placement=True : 是否打印设备分配日志
allow_soft_placement=True :如果你指定的设备不存在,允许TF自动分配设备
tf.ConfigProto(log_device_placement=True,allow_soft_placement=True)
在调用
new_saver.restore(sess, checkpoint_path_data)
出现
InvalidArgumentError: Cannot assign a device for operation 'clone_1/gradients/clone_1/MobileNet/conv_1/batch_norm/moments/sufficient_statistics/Sub_grad/BroadcastGradientArgs_5': Operation was explicitly assigned to /device:GPU:1 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0 ].
InvalidArgumentError: Cannot assign a device for operation 'clone_1/gradients/clone_1/MobileNet/conv_1/batch_norm/moments/sufficient_statistics/Sub_grad/BroadcastGradientArgs_5': Operation was explicitly assigned to /device:GPU:1 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0 ]. Make sure the device specification refers to a valid device. [[Node: clone_1/gradients/clone_1/MobileNet/conv_1/batch_norm/moments/sufficient_statistics/Sub_grad/BroadcastGradientArgs_5 = BroadcastGradientArgs[T=DT_INT32, _device="/device:GPU:1"](clone_1/gradients/clone_1/MobileNet/conv_1/batch_norm/moments/sufficient_statistics/Sub_grad/Shape_6, clone_1/gradients/clone_1/MobileNet/conv_1/batch_norm/moments/sufficient_statistics/Sub_grad/Shape_1_5)]]
..........其中
/device:GPU:1 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0 ]. Make sure the device specification refers to a valid device.
说明,环境无法识别自己的cpu环境,这时就需要
#tf.ConfigProto()的参数
log_device_placement=True : 是否打印设备分配日志
allow_soft_placement=True :如果你指定的设备不存在,允许TF自动分配设备
tf.ConfigProto(log_device_placement=True,allow_soft_placement=True)
相关文章推荐
- Make sure the device specification refers to a valid device
- Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "te
- 使用Genymotion遇到的坑_Genymotion无法启动_unable to start the virtual device
- oracle11g 安装后无法登陆 以及make sure you have the 32 bits oracle client installed问题
- Unity2017 Unable to list target platforms.Please make sure the android sdk path is correct.问题解决!
- Invalid use of SingleClientConnManager: connection still allocatedMake sure to release the connectio
- Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
- TensorFlow 预训练模型导入
- Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "te
- eclipse无法连接genymotion+Unable to start the Genymotion virtual device
- Please make sure the -vm option in eclipse.ini is pointing to a JDK and verify that Installed JRE’s
- TensorFlow训练模型,指定GPU训练,设置显存,查看gpu占用
- Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "te
- eclipse无法连接genymotion+Unable to start the Genymotion virtual device
- tensorflow小白---Operation was explicitly assigned to /device:GPU:1 but available devices are [ /job:l
- Make sure to have the zlib libs …
- NVIDIA显卡 Ubuntu16.04安装驱动后出现问题:Unable to determine the device handle for GPUXXX
- Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "te
- iCloud无法导入vCard问题。fix the error when import vcard/vcf to icloud.
- silverlight地图出错问题A security exception occured while trying to connect to the REST endpoint.Make sure you have a cross...