如何在win10下配置anaconda环境变量
2个回答
2017-07-17
展开全部
1. 设置好GPU开发环境,安装cuda8.0和cudnn5.1
2. 安装Anaconda3-4.3.1-Windows-x86_64,默认Python版本为3.6
3. 安装完以后,打开Anaconda Prompt,输入清世卜华的仓库镜像,更新包更快:
conda config --add channelshttps://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
4. 建立TensorFlow空间:conda create -n tensorflow python=3.5,设置Python版本为3.5
5. 激活TensorFlow空间:activate tensorflow
6. 安装TensorFlow:pip install--ignore-installed --upgrade tensorflow_gpu-1.0.0-cp35-cp35m-win_amd64.whl
7. 测试TensorFlow:
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
设置SSD运行环境
1. 安装numpy(anaconda 离线安装):pipinstall numpy-1.12.1-cp35-none-win_amd64.whl
2. 安装matplotlib(anaconda 离线安装):pipinstall matplotlib-2.0.1-cp35-cp35m-win_amd64.whl
3. 安装opencv(离线):anaconda中安装贺返世:pipinstall opencv_python-3.2.0+contrib-cp35-cp35m-win_amd64.whl
4. 下载TensorFlow版本的SSD:git clone https://github.com/balancap/SSD-Tensorflow.git,或者下载压缩包解压
5. 解压TensorFlowssd目禅肢录下的/checkpoint里的ssd_300_vgg.ckpt.zip,得到模型参数
6. 安装pycharm-community-2017.1.2.exe,python编辑器,File->Setting->Project:Python->ProjectInterpreter:修改Python版本到TensorFlow工作空间下的python
7. 在notebook下新建工程,新建test_ssd.py文件
8. 在pycharm中打开ssd_notebook.ipynb,复制非注释的内容至test_ssd.py下
9. 修改test_ssd.py:
# Test on some demoimage and visualize output.
#path = '../demo/'
#image_names = sorted(os.listdir(path))
#print(image_names)
#for it in image_names:
cam=cv2.VideoCapture(0)
success, img = cam.read()
while success:
#img = cv2.imread(path+it)#mpimg.imread(path + it)
t1=cv2.getTickCount()
rclasses, rscores, rbboxes = process_image(img)
visualization.bboxes_draw_on_img(img,rclasses, rscores, rbboxes, visualization.colors_plasma)
t2=cv2.getTickCount()
print('time consumption:%.3f ms'%(1000*(t2-t1)/cv2.getTickFrequency()))
cv2.imshow('test',img)
c=cv2.waitKey(1)
if c==27:
break
# visualization.bboxes_draw_on_img(img, rclasses,rscores, rbboxes, visualization.colors_plasma)
#visualization.plt_bboxes(img, rclasses,rscores, rbboxes)
success, img = cam.read()
10. 运行程序test_ssd.py
2. 安装Anaconda3-4.3.1-Windows-x86_64,默认Python版本为3.6
3. 安装完以后,打开Anaconda Prompt,输入清世卜华的仓库镜像,更新包更快:
conda config --add channelshttps://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
4. 建立TensorFlow空间:conda create -n tensorflow python=3.5,设置Python版本为3.5
5. 激活TensorFlow空间:activate tensorflow
6. 安装TensorFlow:pip install--ignore-installed --upgrade tensorflow_gpu-1.0.0-cp35-cp35m-win_amd64.whl
7. 测试TensorFlow:
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
设置SSD运行环境
1. 安装numpy(anaconda 离线安装):pipinstall numpy-1.12.1-cp35-none-win_amd64.whl
2. 安装matplotlib(anaconda 离线安装):pipinstall matplotlib-2.0.1-cp35-cp35m-win_amd64.whl
3. 安装opencv(离线):anaconda中安装贺返世:pipinstall opencv_python-3.2.0+contrib-cp35-cp35m-win_amd64.whl
4. 下载TensorFlow版本的SSD:git clone https://github.com/balancap/SSD-Tensorflow.git,或者下载压缩包解压
5. 解压TensorFlowssd目禅肢录下的/checkpoint里的ssd_300_vgg.ckpt.zip,得到模型参数
6. 安装pycharm-community-2017.1.2.exe,python编辑器,File->Setting->Project:Python->ProjectInterpreter:修改Python版本到TensorFlow工作空间下的python
7. 在notebook下新建工程,新建test_ssd.py文件
8. 在pycharm中打开ssd_notebook.ipynb,复制非注释的内容至test_ssd.py下
9. 修改test_ssd.py:
# Test on some demoimage and visualize output.
#path = '../demo/'
#image_names = sorted(os.listdir(path))
#print(image_names)
#for it in image_names:
cam=cv2.VideoCapture(0)
success, img = cam.read()
while success:
#img = cv2.imread(path+it)#mpimg.imread(path + it)
t1=cv2.getTickCount()
rclasses, rscores, rbboxes = process_image(img)
visualization.bboxes_draw_on_img(img,rclasses, rscores, rbboxes, visualization.colors_plasma)
t2=cv2.getTickCount()
print('time consumption:%.3f ms'%(1000*(t2-t1)/cv2.getTickFrequency()))
cv2.imshow('test',img)
c=cv2.waitKey(1)
if c==27:
break
# visualization.bboxes_draw_on_img(img, rclasses,rscores, rbboxes, visualization.colors_plasma)
#visualization.plt_bboxes(img, rclasses,rscores, rbboxes)
success, img = cam.read()
10. 运行程序test_ssd.py
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询