您的位置:首页 > 其它

关于已经安装cuda但是tensorflow仍然使用cpu加速的问题

2018-03-05 17:14 369 查看
平台:ubuntu16.04 LTS
环境:cuda9.1 tensorflow-gpu1.4 nvidia390.25 anconda3.0
问题:cuda配置成功,tensorflow也能够code,但是使用的却是cpu加速,log:Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
解决方法:使用conda list 检查已经安装的包,发现除了tensorflow-gpu之外,还有tensorflow 1.5。猜测可能是因为使用了cpu版本的tensorflow。于是卸载tensorflow,但是并没有起到效果,尝试:conda uninstall protobuf,卸载全部tensorflow相关包,然后conda install tensorflow-gpu。随后编译提示切换设备为gpu0,成功使用gpu加速。
提示:keras和tensorflow不能共存。在conda install keras的时候会一起安装tensorflow,可能会导致上述问题。
参考:https://stackoverflow.com/questions/42326748/tensorflow-on-gpu-no-known-devices-despite-cudas-devicequery-returning-a-pas
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐