跑TensorFlow代码

2020-11-08  本文已影响0人  rensgf

1、利用.yml文件配置整套环境

conda env create -f dev_gpu.yml

2、微调环境,主要使用pip install和pip uninstall 调整至对应版本

3、使用gpu时,注意要使用TensorFlow-GPU

4、注意TensorFlow和cuda\cudnn 的搭配

https://blog.csdn.net/omodao1/article/details/83241074

5、import TensorFlow

若出现错误, ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory

需要在path中加入cuda

具体见链接:https://blog.csdn.net/qq_34374211/article/details/81018320

其中vim编辑时,ESC表示退出,之后输入:wq命令,表示保存并退出

6、之前出现的代码跑起来但是GPU占用却为0的原因是版本不匹配问,或者是没有使用TensorFlow-gpu

上一篇 下一篇

猜你喜欢

热点阅读