1.安装cuda以及CUDNN
桌面,鼠标右击,点击nvidia控制面板
进入下边的界面后,点击左下角系统信息
点击左下角系统信息,点击组件进入如下界面,这有个版本号,按照这个下载cuda的版本,不需要最高的版本,可以向下兼容(如:10.5可以装10.0)
下载与安装
Cuda
Cudnn
安装教程
这里由于我的电脑中安装了两个版本的vs,导致cuda的vs插件安装失败,卸载其中一个vs就好了。
2.安装Anaconda
参考教程:https://blog.csdn.net/weixin_43715458/article/details/100096496
3.创建并激活虚拟环境
清华大学镜像源地址:https://pypi.tuna.tsinghua.edu.cn/simple
创建虚拟环境:conda create --prefix=指定路径\虚拟环境名字 python=3.8(版本)
默认anaconda安装目录 conda create -n 虚拟环境名 python=3.8(版本)

激活虚拟环境:activate 指定路径/环境名

4.安装各种包
使用pip/conda 命令安装包 imgaug,numpy、scipy、Pillow,jupyter,cython,matplotlib,scikit-image,opencv-python,h5py,IPython
pip install imgaug numpy scipy Pillow jupytercython matplotlib scikit-image opencv-python h5py IPython

5.安装Tensorflow
Tensorflow有gpu和cpu两个版本,gpu需要与cuda版本对应起来,可以同时装,默认使用高版本的,同版本默认使用gpu,tensorflow>=1.5,keras>=2.0.8与tensorflow版本对应起来。
安装:pip install tensorflow-gpu
Tesorflow-GPU安装测试:
python
import tensorflow as tf
tf.test.is_gpu_available()
tf.test.is_built_with_cuda()

6. 安装pycocotools
github网址:https://github.com/philferriere/cocoapi
如果是使用自己的训练集,不需要这个,如果是使用MS coco数据集,需要下载。
git 安装:git clone https://github.com/philferriere/cocoapi.git
pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
若这一步出错,可参考:https://blog.csdn.net/m0_46976404/article/details/107967133
登陆网站,下载压缩包,cocoapi-master.zip,解压后进入PythonAPI,在这一目录下运行
python setup.py build_ext install
7.下载maskrcnn
git clone https://github.com/matterport/Mask_RCNN
解压,在这一目录下运行
jupyter notebook

进入网页

点击sample,进入

点击demo.ipynb,运行

若出现keras模块错误,可能是keras与tensorflow版本不对应的问题。
可参考下面的版本
https://github.com/matterport/Mask_RCNN/issues/2587

本文档详细介绍了如何配置深度学习环境,包括安装CUDA和CUDNN,设置Anaconda,创建虚拟环境,安装必要的库如Tensorflow和pycocotools,以及下载和运行Mask R-CNN。过程中特别提到了Tensorflow与CUDA版本的对应问题,以及pycocotools的安装方法。最后,通过运行Mask R-CNN的示例验证了环境配置的成功。
5364

被折叠的 条评论
为什么被折叠?



