http://iyenn.com/rec/1662706.html
编写 demo.py
- import tensorflow as tf
- sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
查看日志信息若包含gpu信息,就是使用了gpu。
执行 demo.py
执行方式1:在 python-IDLE 中打开文件demo.py 并 Run Model :
- >>>
- == RESTART: D:\下载\forGPU--CUDA--TensorFlow--CUDNN\tensorflow-gpu_demo_01.py ==
- >>>
什么情况?没有 gpu 信息?
执行方式2:在cmd下执行demo.py :
- D:\下载\forGPU--CUDA--TensorFlow--CUDNN>tensorflow-gpu_demo_01.py
- 2018-11-02 17:25:34.590159: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary
评论记录:
回复评论: