MaskRCNN学习(一)——win10环境下配置运行

人工智能87

1. 项目地址

https://github.com/matterport/Mask_RCNN

2. 安装过程

2.1 创建虚拟环境

打开Anaconda Prompt进入保存的项目地址,执行 conda create -n maskrcnn python=3.6命令。

成功创建环境后,执行 conda activate maskrcnn命令,进入环境。

2.3 安装Tensorflow和Keras

注意 Tensorflow和Keras具有对应关系,可参考https://www.cnblogs.com/carle-09/p/11661261.html
在这里我使用的是tensorflow 1.14.0 + Keras 2.2.5

运行命令

pip install tensorflow-gpu==1.14.0 -i https://pypi.tuna.tsinghua.edu.cn/simple

没有GPU就用

pip install tensorflow==1.14.0 -i https://pypi.tuna.tsinghua.edu.cn/simple

安装Keras

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple keras==2.2.5

2.3 根据requirements.txt安装相应的依赖

运行命令 pip install -r requirements.txt

注意 如果用上一条命令安装的太慢,可以使用国内镜像逐个安装,例如安装matplotlib:

pip install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple

其他的包改一下名字就可以。

输入 conda list查看已安装的包,看看是否安装成功

3. 下载训练好的COCO权重mask_rcnn_coco.h5

直接在github下载太慢,建议使用网盘进行下载
链接:https://pan.baidu.com/s/1wzfsBREJHtYORBo8oC1P_g
提取码:gsud

4. 安装pycocotools

4.1 安装vc++ 2015构建工具

https://download.microsoft.com/download/5/f/7/5f7acaeb-8363-451f-9425-68a90f98b238/visualcppbuildtools_full.exe
下载后安装

4.2 安装pycocotools

输入命令 pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI

5. 使用jupyter notebook运行demo.ipynb

直接在命令行中输入 jupyter notebook,显示如下
MaskRCNN学习(一)——win10环境下配置运行
打开sample目录下的demo.ipynb文件并运行。

最终运行成功的结果如下图所示:

MaskRCNN学习(一)——win10环境下配置运行

Original: https://blog.csdn.net/bruce_zhao1407/article/details/122390851
Author: 溪午不闻钟_
Title: MaskRCNN学习(一)——win10环境下配置运行