当前位置:网站首页>记一次搭建conda虚拟环境
记一次搭建conda虚拟环境
2022-07-30 01:36:00 【Wsyoneself】
将下方的版本号根据自己的需求指定CUDA ,Python ,Tensorflow/Tensorflow-gpu的版本号
- 创建环境(或者界面可视化创建也可):
conda create -n 环境名称 python=版本号 - conda查看目前所有虚拟环境以及环境所在路径:
conda info --envs - 激活环境:
conda activate 环境名称 - 安装cuda:
conda install cudatoolkit=版本号 conda install cudnn (这一句可以不指定版本,会默认和上一句配套安装的) - 查看conda目前支持的cudatoolkit版本:
conda search cudatoolkit --info - 安装TensorFlow:
- 如果是cpu版本,安装tensorflow1.0.0:
conda install --channel https://conda.anaconda.org/anaconda tensorflow=版本号 - 如果是gpu版本:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow-gpu=1.0.0,测试是否安装正确(因为TensorFlow,cuda,python的版本需要对应,才算安装成功)
- 测试代码:
import tensorflow as tf tf.test.is_gpu_available()如果返回True,则说明很幸运,安装成功了
- 遇到的报错:import tensorflow 报错SyntaxError: invalid syntax 解决:
pip install protobuf==3.17.3
- 测试代码:
- 如果是cpu版本,安装tensorflow1.0.0:
- 补充,关于版本对应:
- cpu:

- gpu:

- cpu:
成功的截图:

边栏推荐
猜你喜欢

CAPL中的键值对(hash)数据类型

泰克Tektronix示波器软件TDS1012|TDS2002|TDS2004上位机软件NS-Scope

自学HarmonyOS应用开发(53)- 获取当前位置

【LeetCode每日一题】——872.叶子相似的树

自学HarmonyOS应用开发(49)- 引入地图功能

经典毕业设计:基于SSM实现高校后勤报修系统

Towards Better Understanding of Self-Supervised Representations / Q-Score

Unity便携式 VR 的实现

Fabric Writing Case Chaincode

LeetCode/Scala - without the firstborn of the string of characters, the longest text string back
随机推荐
专心致志做事情
App测试需要测什么
自学HarmonyOS应用开发(47)- 自定义switch组件
华为“天才少年”稚晖君又出新作,从零开始造“客制化”智能键盘
It is really strong to apply the @Transactional transaction annotation to such perfection!
数据流图、数据字典
「MySQL」- 基础增删改查
视觉系统设计实例halcon-winform-11.菜单折叠与展示
mysql error is too long for user name (should be no longer than 16)
软考 --- 数据库(5)数据库控制
LeetCode 2342. 数位和相等数对的最大和
将镜像推送到阿里云私有仓库
【MySQL总结】
LeetCode 2342. Digital and equal number of one of the biggest and
Talk about the construction of the performance test environment
基于燃压缩空气储能系统的零碳微能源互联网优化调度(Matlab代码实现)
exness: U.S. GDP shrinks, yen bounces back
Fabric Private Data Case
在服务器上运行node流程
npm ERR! code ENOTSUPnpm ERR! notsup Unsupported engine for [email protected]: wanted: {“n