Tensorflow从开始到放弃(技术篇)

  1. 在gpu中运行
    tf.device("/gpu:1")
    有时候这个是会出问题的,即便你在有名称为1的gpu时。有的操作是不能支持gpu的,应该为session添加一些配置:
    sess=tf.InteractiveSession(config=tf.ConfigProto(allow_soft_placement=True,log_device_placement=True))
    
    这样会在不支持gpu的时候自动使用cpu
  2. 查看gpu使用情况
    nvidia-smi -l

未完待续

posted @ 2019-05-31 17:02  yutou2016  阅读(280)  评论(0编辑  收藏  举报