Mask_RCNN安装(ROS环境下)

github-code
因为一开始MASKRCNN使用COCO训练的,所以其识别分割种类有80种

教程步骤:
1.conda create -n maskrcnn python=3.4
2.pip3 install -r requirements.txt
报错如下,但是不做处理

ERROR: scikit-image 0.15.0 has requirement pillow>=4.3.0, but you'll have pillow 3.1.2 which is incompatible.
ERROR: markdown 3.1.1 has requirement setuptools>=36, but you'll have setuptools 20.7.0 which is incompatible.
ERROR: tensorboard 2.1.0 has requirement requests<3,>=2.21.0, but you'll have requests 2.9.1 which is incompatible.
ERROR: tensorboard 2.1.0 has requirement setuptools>=41.0.0, but you'll have setuptools 20.7.0 which is incompatible.
ERROR: google-auth 1.11.0 has requirement setuptools>=40.3.0, but you'll have setuptools 20.7.0 which is incompatible.

后面在maskrcnn的环境下再次运行,(可能上一次在其他conda环境)重新下载,后中途报错

ERROR: grpcio 1.26.0 requires enum34>=1.0.4, which is not installed.
ERROR: grpcio 1.26.0 requires futures>=2.2.0, which is not installed.
ERROR: tensorboard 1.14.0 has requirement setuptools>=41.0.0, but you'll have setuptools 27.2.0 which is incompatible

使用pip3 install setuptools==41.0 不全setuptools的版本

3.python3 setup.py install
Finished processing dependencies for mask-rcnn==2.1
4.Download mask_rcnn_coco.h5(我是用手机挂tizi然后传到电脑)存在root director下
5.(最好安装)下载pycocotools来train or test on MS COCO
github上也有关于MS COCO Requirements的说明
Linux中直接使用:
pip3 install pycocotools

How To Get Started
各种jupyter notebook的作用,这里不做翻译了

    demo.ipynb Is the easiest way to start. It shows an example of using a model pre-trained on MS COCO to segment objects in your own images. It includes code to run object detection and instance segmentation on arbitrary images.

    train_shapes.ipynb shows how to train Mask R-CNN on your own dataset. This notebook introduces a toy dataset (Shapes) to demonstrate training on a new dataset.

    (model.py, utils.py, config.py): These files contain the main Mask RCNN implementation.

    inspect_data.ipynb. This notebook visualizes the different pre-processing steps to prepare the training data.

    inspect_model.ipynb This notebook goes in depth into the steps performed to detect and segment objects. It provides visualizations of every step of the pipeline.

    inspect_weights.ipynb This notebooks inspects the weights of a trained model and looks for anomalies and odd patterns.

在maskrcnn的目录cmd下输入jupyter notebook
运行samples/demo
如果安装了ros,则会报错

ImportError: /opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so: undefined symbol: PyCObject_Type
参考:https://blog.csdn.net/qq_34544129/article/details/81946494
分析:不一定是ROS的缘故,还有可能是多版本python的缘故

解决方案:
在bashrc加上

export PYTHONPATH="/home/asber/Document/anaconda2/lib/python2.7/site-packages:$PYTHONPATH"

之后进入maskrcnn执行jupyter notebook报错

importerror: this package should not be accessible on python 3. either you are trying to run from the python-future src folder or your install…

这个问题在shell执行unset PYTHONPATH可以解决

我在base环境下jupyter notebook报错
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe5 in position 4: ordinal not in range(128)
在gedit /home/asber/Document/anaconda2/lib/python2.7/site-packages/jupyter_core/application.py
import sys
reload(sys)
sys.setdefaultencoding(‘utf-8’)
之后还是编码报错
[C 11:28:39.943 NotebookApp] Bad config encountered during initialization:
[C 11:28:39.943 NotebookApp] Could not decode ‘\xe6\x9c\xaa\xe5\x91\xbd\xe5\x90\x8d’ for unicode trait ‘untitled_notebook’ of a LargeFileManager instance.
最后gedit /home/asber/Document/anaconda2/lib/python2.7/site-packages/traitlets/traitlets.py
change line 2050, from return value.decode(‘ascii’, ‘strict’) to return value.decode(‘UTF-8’, ‘strict’)
解决错误,参考

运行结果
在这里插入图片描述

PS:最后github上还介绍了一个3Ddataset for 点云分割
参考:
1.此处还有使用cv2读取摄像头进行分割的代码
2.Mask RCNN 算法笔记
3.Mask-RCNN模型的实现自定义对象(无人机)检测
4.『深度应用』一小时教你上手训练MaskRCNN·Keras开源实战(Windows&Linux)

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值