2020-08-22-环境配置

在anaconda中创建虚拟环境
conda create --name tf_gpu_env2 python=3.6
查看所有的虚拟环境
conda info --envs
连接环境
source activate tf_gpu_env2
关闭环境
source deactivate

查看tensorflow各个版本:(查看会发现有一大堆TensorFlow源,但是不能随便选,选择可以用查找命令定位)
anaconda search -t conda tensorflow-gpu
查看tensorflow版本信息
anaconda show anaconda/tensorflow-gpu
安装指定版本
conda install --channel https://conda.anaconda.org/anaconda tensorflow-gpu=1.12.0

错误1:
Traceback (most recent call last):
File “setup.py”, line 4, in
from Cython.Build import cythonize
ModuleNotFoundError: No module named 'Cython’
mv: cannot stat ‘build//.so’: No such file or directory

解决方法:在虚拟环境中 python -m pip install cython

错误2:
Traceback (most recent call last):
File “./main/demo.py”, line 7, in
import cv2
ModuleNotFoundError: No module named 'cv2’

解决方法:pip install opencv-python

错误3(警告?)
/home/cheoywoo/anaconda3/envs/tf_gpu_env2/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:523: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_qint8 = np.dtype([(“qint8”, np.int8, 1)])
/home/cheoywoo/anaconda3/envs/tf_gpu_env2/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:524: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.

numpy1-17-0版本过高,使用numpy-1.16-0

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值