centos7 conda 安装 tensorflow

  在自己的虚拟环境sks_test 里面安装

  安装之前要确认自己安装的版本:依据[环境配置] Python tensorflow CUDA cuDNN版本对照表

  命令:conda  install -n sks_test tensorflow-gpu=1.9.0

  

 

 

 

 

  enviroment_location:  /home/shaokuangshan/anaconda3/envs/sks_test

  提示

  

 

 

  输入y

  安装过程报错:结果出现了“CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/current_repodata.json

  修改 .condarc

  vi .condarc

   改为:

channels:
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/
show_channel_urls: true

  再次conda  install -n sks_test tensorflow-gpu=1.9.0 执行成功

  下载过程又出现个别文件下载中断:

  CondaError: Downloaded bytes did not match Content-Length
  url: http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/cudatoolkit-9.0-1.tar.bz2
  target_path: /home/shaokuangshan/anaconda3/pkgs/cudatoolkit-9.0-1.tar.bz2
  Content-Length: 356266073
  downloaded bytes: 75128516

  因此进入/home/shaokuangshan/anaconda3/pkgs目录

  单独下载:cudatoolkit-9.0-1

  wget http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/cudatoolkit-9.0-1.tar.bz2

  wget http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/cudnn-7.6.5-cuda9.0_0.tar.bz2 

posted on 2021-06-03 15:13  shaomine  阅读(202)  评论(0编辑  收藏  举报