tensorflow安装及导入pycharm

时间:2024-04-02 15:47:14

一、Anconda安装

  • 网站:https://www.anaconda.com/

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

二、安装CUDA(cudnn)和配置环境变量

  • 先查看安装的tensorflow版本对应的CUAD的版本号
  • 网站:https://tensorflow.google.cn/install/source#linu
  • 实例:安装下面这一版:

tensorflow安装及导入pycharm

  • CUDA下载网址:https://developer.nvidia.com/CUDA-TOOLKIT-ARCHIVE

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

  • CUDA安装:

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

  • CUDNN下载:

  • 下载网址:https://developer.nvidia.com/rdp/cudnn-archive

tensorflow安装及导入pycharm

下载完成后将文件解压到当前目录下改名为cudnn

然后将次文件复制粘贴到:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0的路径下

  • 配置环境变量:

tensorflow安装及导入pycharm

找到路径:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA**\v10.0\extras\CUPTI\libx64**

tensorflow安装及导入pycharm

找到路径:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA**\v10.0\cudnn\cuda\bin**

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

  • 检查cuda是否安装成功:
  • win+r:进入dos窗口:

tensorflow安装及导入pycharm

即成功:

tensorflow安装及导入pycharm

三、安装tensorflow

tensorflow安装及导入pycharm

因为下载的anconda自带的python时3.8的我们用的是python3.7所以在按装一个3.7的版本

安装python3.7版tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

安装tensorflow1.14.0版

tensorflow安装及导入pycharm

检测tensorflow是否安装成功

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

四、pycharm中导入tensorflow

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm

tensorflow安装及导入pycharm
测试是否成功:
tensorflow安装及导入pycharm