- 使用字符串
string
来标识CPU设备或GPU设备:例:'\cpu:0'
,'\gpu:0'
- 在同时拥有CPU和GPU设备时,GPU设备的使用具有优先权
- 记录执行op或tensor的指派设备:设置
log_device_placement=True
...
with tf.Session(config=tf.ConfigProto(log_device_placement=True)) as sess:
.
string
来标识CPU设备或GPU设备:例:'\cpu:0'
,'\gpu:0'
log_device_placement=True
...
with tf.Session(config=tf.ConfigProto(log_device_placement=True)) as sess:
.