我已经在ubuntu 16.04中使用第二个答案在 ubuntu的内置apt cuda安装中安装了tensorflow 。
现在我的问题是如何测试tensorflow是否真的在使用gpu?我有一个gtx 960m gpu。当我import tensorflow
这是输出
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcurand.so locally
这个输出足以检查tensorflow是否正在使用gpu吗?
log_device_placement
办法回答。最可靠的办法就是看看时间表在此评论规定:github.com/tensorflow/tensorflow/issues/...