MaskRCNN代码训练复现流程以及相关问题解决

一、下载Mask_RCNN的源码:

源码下载地址:Mask_RCNN
在这里插入图片描述
在这里插入图片描述

二、创建环境

2.1 Anaconda创建一个虚拟环境

bit@bit-613:~$ source activate
(base) bit@bit-613:~$ 
(base) bit@bit-613:~$ 
(base) bit@bit-613:~$ conda create -n MaskRCNN python=3.6
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.5.4
  latest version: 4.10.3

Please update conda by running

    $ conda update -n base conda



## Package Plan ##

  environment location: /home/bit/anaconda3/envs/MaskRCNN

  added / updated specs: 
    - python=3.6


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    python_abi-3.6             |          2_cp36m           4 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    certifi-2021.5.30          |   py36h5fab9bb_0         141 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    ------------------------------------------------------------
                                           Total:         145 KB

The following NEW packages will be INSTALLED:

    _libgcc_mutex:    0.1-conda_forge           https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    _openmp_mutex:    4.5-1_gnu                 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    ca-certificates:  2021.5.30-ha878542_0      https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    certifi:          2021.5.30-py36h5fab9bb_0  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    ld_impl_linux-64: 2.36.1-hea4e1c9_1         https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    libffi:           3.3-h58526e2_2            https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    libgcc-ng:        9.3.0-h2828fa1_19         https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    libgomp:          9.3.0-h2828fa1_19         https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    libstdcxx-ng:     9.3.0-h6de172a_19         https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    ncurses:          6.2-h58526e2_4            https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    openssl:          1.1.1k-h7f98852_0         https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    pip:              21.1.3-pyhd8ed1ab_0       https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    python:           3.6.13-hffdb5ce_0_cpython https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    python_abi:       3.6-2_cp36m               https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    readline:         8.1-h46c0cb4_0            https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    setuptools:       49.6.0-py36h5fab9bb_3     https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    sqlite:           3.36.0-h9cd32fc_0         https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    tk:               8.6.10-h21135ba_1         https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    wheel:            0.36.2-pyhd3deb0d_0       https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    xz:               5.2.5-h516909a_1          https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    zlib:             1.2.11-h516909a_1010      https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge

Proceed ([y]/n)? y


Downloading and Extracting Packages
python_abi-3.6       |    4 KB | ####################################### | 100% 
certifi-2021.5.30    |  141 KB | ####################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate MaskRCNN
#
# To deactivate an active environment, use
#
#     $ conda deactivate

(base) bit@bit-613:~$ conda activate MaskRCNN
(MaskRCNN) bit@bit-613:~$ 
(MaskRCNN) bit@bit-613:~$ 

进入项目的:

(MaskRCNN) bit@bit-613:~$ cd MaskRCNN/
(MaskRCNN) bit@bit-613:~/MaskRCNN$ ls
Mask_RCNN-master  Mask_RCNN-master.zip 
(MaskRCNN) bit@bit-613:~/MaskRCNN$ cd Mask_RCNN-master/
(MaskRCNN) bit@bit-613:~/MaskRCNN/Mask_RCNN-master$ ls
assets  LICENSE      mrcnn      requirements.txt  setup.cfg
images  MANIFEST.in  README.md  samples           setup.py
(MaskRCNN) bit@bit-613:~/MaskRCNN/Mask_RCNN-master$ 

2. 安装必要依赖包

采用手动安装requirements中各个包:

首先配置最重要的keras和tensorflow,注意版本号.
在这里插入图片描述

查询Cuda版本

(MaskRCNN) bit@bit-613:~/MaskRCNN/Mask_RCNN-master$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130

根据电脑中CUDA版本确定TensorFlow的版本号。

2.1.1 安装tensorflow
(MaskRCNN) bit@bit-613:~/MaskRCNN/Mask_RCNN-master$ pip install tensorflow-gpu==1.13.0
ERROR: Could not find a version that satisfies the requirement tensorflow-gpu==1.13.0 (from versions: 0.12.1, 1.0.0, 1.0.1, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.7.1, 1.8.0, 1.9.0, 1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.12.2, 1.12.3, 1.13.1, 1.13.2, 1.14.0, 1.15.0rc0, 1.15.0rc1, 1.15.0rc2, 1.15.0rc3, 1.15.0, 1.15.2, 1.15.3, 1.15.4, 1.15.5, 2.0.0a0, 2.0.0b0, 2.0.0b1, 2.0.0rc0, 2.0.0rc1, 2.0.0rc2, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.1.0rc0, 2.1.0rc1, 2.1.0rc2, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.2.0rc0, 2.2.0rc1, 2.2.0rc2, 2.2.0rc3, 2.2.0rc4, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.3.0rc0, 2.3.0rc1, 2.3.0rc2, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.4.0rc0, 2.4.0rc1, 2.4.0rc2, 2.4.0rc3, 2.4.0rc4, 2.4.0, 2.4.1, 2.4.2, 2.5.0rc0, 2.5.0rc1, 2.5.0rc2, 2.5.0rc3, 2.5.0, 2.6.0rc0, 2.6.0rc1)
ERROR: No matching distribution found for tensorflow-gpu==1.13.0
(MaskRCNN) bit@bit-613:~/MaskRCNN/Mask_RCNN-master$ pip install tensorflow-gpu==1.13.1
Collecting tensorflow-gpu==1.13.1
  Using cached tensorflow_gpu-1.13.1-cp36-cp36m-manylinux1_x86_64.whl (345.2 MB)
Requirement already satisfied: termcolor>=1.1.0 in /home/bit/.local/lib/python3.6/site-packages (from tensorflow-gpu==1.13.1) (1.1.0)
Collecting tensorboard<1.14.0,>=1.13.0
  Using cached tensorboard-1.13.1-py3-none-any.whl (3.2 MB)
Requirement already satisfied: absl-py>=0.1.6 in /home/bit/.local/lib/python3.6/site-packages (from tensorflow-gpu==1.13.1) (0.12.0)
Collecting keras-applications>=1.0.6
  Using cached Keras_Applications-1.0.8-py3-none-any.whl (50 kB)
Collecting grpcio>=1.8.6
  Downloading grpcio-1.38.1-cp36-cp36m-manylinux2014_x86_64.whl (4.2 MB)
     |████████████████████████████████| 4.2 MB 839 kB/s 
Collecting tensorflow-estimator<1.14.0rc0,>=1.13.0
  Using cached tensorflow_estimator-1.13.0-py2.py3-none-any.whl (367 kB)
Collecting gast>=0.2.0
  Downloading gast-0.5.0-py3-none-any.whl (10 kB)
Collecting six>=1.10.0
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting astor>=0.6.0
  Using cached astor-0.8.1-py2.py3-none-any.whl (27 kB)
Requirement already satisfied: wheel>=0.26 in /home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages (from tensorflow-gpu==1.13.1) (0.36.2)
Collecting numpy>=1.13.3
  Using cached numpy-1.19.5-cp36-cp36m-manylinux2010_x86_64.whl (14.8 MB)
Collecting keras-preprocessing>=1.0.5
  Using cached Keras_Preprocessing-1.1.2-py2.py3-none-any.whl (42 kB)
Requirement already satisfied: protobuf>=3.6.1 in /home/bit/.local/lib/python3.6/site-packages (from tensorflow-gpu==1.13.1) (3.15.6)
Collecting h5py
  Using cached h5py-3.1.0-cp36-cp36m-manylinux1_x86_64.whl (4.0 MB)
Requirement already satisfied: markdown>=2.6.8 in /home/bit/.local/lib/python3.6/site-packages (from tensorboard<1.14.0,>=1.13.0->tensorflow-gpu==1.13.1) (3.3.4)
Requirement already satisfied: werkzeug>=0.11.15 in /home/bit/.local/lib/python3.6/site-packages (from tensorboard<1.14.0,>=1.13.0->tensorflow-gpu==1.13.1) (1.0.1)
Requirement already satisfied: importlib-metadata in /home/bit/.local/lib/python3.6/site-packages (from markdown>=2.6.8->tensorboard<1.14.0,>=1.13.0->tensorflow-gpu==1.13.1) (3.7.3)
Collecting mock>=2.0.0
  Using cached mock-4.0.3-py3-none-any.whl (28 kB)
Collecting cached-property
  Using cached cached_property-1.5.2-py2.py3-none-any.whl (7.6 kB)
Requirement already satisfied: typing-extensions>=3.6.4 in /home/bit/.local/lib/python3.6/site-packages (from importlib-metadata->markdown>=2.6.8->tensorboard<1.14.0,>=1.13.0->tensorflow-gpu==1.13.1) (3.7.4.3)
Requirement already satisfied: zipp>=0.5 in /home/bit/.local/lib/python3.6/site-packages (from importlib-metadata->markdown>=2.6.8->tensorboard<1.14.0,>=1.13.0->tensorflow-gpu==1.13.1) (3.4.1)
Installing collected packages: six, numpy, cached-property, mock, h5py, grpcio, tensorflow-estimator, tensorboard, keras-preprocessing, keras-applications, gast, astor, tensorflow-gpu
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
matplotlib 3.3.4 requires pillow>=6.2.0, which is not installed.
cvpods 0.1 requires Pillow>=7.1, which is not installed.
cvpods 0.1 requires torch, which is not installed.
cvpods 0.1 requires torchvision, which is not installed.
Successfully installed astor-0.8.1 cached-property-1.5.2 gast-0.5.0 grpcio-1.38.1 h5py-3.1.0 keras-applications-1.0.8 keras-preprocessing-1.1.2 mock-4.0.3 numpy-1.19.5 six-1.16.0 tensorboard-1.13.1 tensorflow-estimator-1.13.0 tensorflow-gpu-1.13.1
(MaskRCNN) bit@bit-613:~/MaskRCNN/Mask_RCNN-master$ pip list
Package                Version             Location
---------------------- ------------------- ----------------
absl-py                0.12.0
appdirs                1.4.4
astor                  0.8.1
cached-property        1.5.2
cachetools             4.2.1
certifi                2021.5.30
chardet                4.0.0
cloudpickle            1.6.0
colorama               0.4.4
cvpods                 0.1                 /home/bit/cvpods
cycler                 0.10.0
Cython                 0.29.22
easydict               1.9
future                 0.18.2
gast                   0.5.0
google-auth            1.28.0
google-auth-oauthlib   0.4.3
grpcio                 1.38.1
h5py                   3.1.0
idna                   2.10
importlib-metadata     3.7.3
Keras-Applications     1.0.8
Keras-Preprocessing    1.1.2
kiwisolver             1.3.1
Markdown               3.3.4
matplotlib             3.3.4
mock                   4.0.3
numpy                  1.19.5
oauthlib               3.1.0
pandas                 1.1.5
pip                    21.1.3
portalocker            2.2.1
protobuf               3.15.6
pyasn1                 0.4.8
pyasn1-modules         0.2.8
pycocotools            2.0.2
pydot                  1.4.2
pyparsing              2.4.7
python-dateutil        2.8.1
pytz                   2021.1
requests               2.25.1
requests-oauthlib      1.3.0
rsa                    4.7.2
scipy                  1.5.4
seaborn                0.11.1
setuptools             49.6.0.post20210108
six                    1.16.0
tabulate               0.8.9
tensorboard            1.13.1
tensorboard-plugin-wit 1.8.0
tensorflow-estimator   1.13.0
tensorflow-gpu         1.13.1
termcolor              1.1.0
tqdm                   4.59.0
typing-extensions      3.7.4.3
urllib3                1.26.4
Werkzeug               1.0.1
wheel                  0.36.2
zipp                   3.4.1

2.1.2 安装pillow
(MaskRCNN) bit@bit-613:~/MaskRCNN/Mask_RCNN-master$ pip install pillow
Collecting pillow
  Downloading Pillow-8.3.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (3.0 MB)
     |████████████████████████████████| 3.0 MB 837 kB/s 
Installing collected packages: pillow
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
cvpods 0.1 requires torch, which is not installed.
cvpods 0.1 requires torchvision, which is not installed.
Successfully installed pillow-8.3.1

2.1.3 安装keras
(MaskRCNN) bit@bit-613:~/MaskRCNN/Mask_RCNN-master$ pip  install keras
Collecting keras
  Downloading Keras-2.4.3-py2.py3-none-any.whl (36 kB)
Requirement already satisfied: numpy>=1.9.1 in /home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages (from keras) (1.19.5)
Requirement already satisfied: scipy>=0.14 in /home/bit/.local/lib/python3.6/site-packages (from keras) (1.5.4)
Requirement already satisfied: h5py in /home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages (from keras) (3.1.0)
Collecting pyyaml
  Downloading PyYAML-5.4.1-cp36-cp36m-manylinux1_x86_64.whl (640 kB)
     |████████████████████████████████| 640 kB 956 kB/s 
Requirement already satisfied: cached-property in /home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages (from h5py->keras) (1.5.2)
Installing collected packages: pyyaml, keras
Successfully installed keras-2.4.3 pyyaml-5.4.1

2.1.4 安装scikit-image
(MaskRCNN) bit@bit-613:~/MaskRCNN/Mask_RCNN-master$ pip install scikit-image
Collecting scikit-image
  Using cached scikit_image-0.17.2-cp36-cp36m-manylinux1_x86_64.whl (12.4 MB)
Requirement already satisfied: numpy>=1.15.1 in /home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages (from scikit-image) (1.19.5)
Requirement already satisfied: matplotlib!=3.0.0,>=2.0.0 in /home/bit/.local/lib/python3.6/site-packages (from scikit-image) (3.3.4)
Collecting PyWavelets>=1.1.1
  Using cached PyWavelets-1.1.1-cp36-cp36m-manylinux1_x86_64.whl (4.4 MB)
Collecting networkx>=2.0
  Using cached networkx-2.5.1-py3-none-any.whl (1.6 MB)
Requirement already satisfied: scipy>=1.0.1 in /home/bit/.local/lib/python3.6/site-packages (from scikit-image) (1.5.4)
Collecting tifffile>=2019.7.26
  Using cached tifffile-2020.9.3-py3-none-any.whl (148 kB)
Collecting imageio>=2.3.0
  Using cached imageio-2.9.0-py3-none-any.whl (3.3 MB)
Requirement already satisfied: pillow!=7.1.0,!=7.1.1,>=4.3.0 in /home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages (from scikit-image) (8.3.1)
Requirement already satisfied: python-dateutil>=2.1 in /home/bit/.local/lib/python3.6/site-packages (from matplotlib!=3.0.0,>=2.0.0->scikit-image) (2.8.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in /home/bit/.local/lib/python3.6/site-packages (from matplotlib!=3.0.0,>=2.0.0->scikit-image) (2.4.7)
Requirement already satisfied: cycler>=0.10 in /home/bit/.local/lib/python3.6/site-packages (from matplotlib!=3.0.0,>=2.0.0->scikit-image) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/bit/.local/lib/python3.6/site-packages (from matplotlib!=3.0.0,>=2.0.0->scikit-image) (1.3.1)
Requirement already satisfied: six in /home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages (from cycler>=0.10->matplotlib!=3.0.0,>=2.0.0->scikit-image) (1.16.0)
Collecting decorator<5,>=4.3
  Using cached decorator-4.4.2-py2.py3-none-any.whl (9.2 kB)
Installing collected packages: decorator, tifffile, PyWavelets, networkx, imageio, scikit-image
Successfully installed PyWavelets-1.1.1 decorator-4.4.2 imageio-2.9.0 networkx-2.5.1 scikit-image-0.17.2 tifffile-2020.9.3
2.1.5 安装opencv-python
(MaskRCNN) bit@bit-613:~/MaskRCNN/Mask_RCNN-master$ pip install opencv-python
Collecting opencv-python
  Downloading opencv_python-4.5.3.56-cp36-cp36m-manylinux2014_x86_64.whl (49.9 MB)
     |████████████████████████████████| 49.9 MB 59 kB/s 
Requirement already satisfied: numpy>=1.13.3 in /home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages (from opencv-python) (1.19.5)
Installing collected packages: opencv-python
Successfully installed opencv-python-4.5.3.56

2.1.6 安装imgaug
(MaskRCNN) bit@bit-613:~/MaskRCNN/Mask_RCNN-master$ pip install imgaug
Collecting imgaug
  Downloading imgaug-0.4.0-py2.py3-none-any.whl (948 kB)
     |████████████████████████████████| 948 kB 576 kB/s 
Requirement already satisfied: imageio in /home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages (from imgaug) (2.9.0)
Requirement already satisfied: numpy>=1.15 in /home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages (from imgaug) (1.19.5)
Requirement already satisfied: matplotlib in /home/bit/.local/lib/python3.6/site-packages (from imgaug) (3.3.4)
Requirement already satisfied: Pillow in /home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages (from imgaug) (8.3.1)
Requirement already satisfied: six in /home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages (from imgaug) (1.16.0)
Requirement already satisfied: scipy in /home/bit/.local/lib/python3.6/site-packages (from imgaug) (1.5.4)
Collecting Shapely
  Downloading Shapely-1.7.1-cp36-cp36m-manylinux1_x86_64.whl (1.0 MB)
     |████████████████████████████████| 1.0 MB 29.7 MB/s 
Requirement already satisfied: opencv-python in /home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages (from imgaug) (4.5.3.56)
Requirement already satisfied: scikit-image>=0.14.2 in /home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages (from imgaug) (0.17.2)
Requirement already satisfied: tifffile>=2019.7.26 in /home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages (from scikit-image>=0.14.2->imgaug) (2020.9.3)
Requirement already satisfied: networkx>=2.0 in /home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages (from scikit-image>=0.14.2->imgaug) (2.5.1)
Requirement already satisfied: PyWavelets>=1.1.1 in /home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages (from scikit-image>=0.14.2->imgaug) (1.1.1)
Requirement already satisfied: cycler>=0.10 in /home/bit/.local/lib/python3.6/site-packages (from matplotlib->imgaug) (0.10.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in /home/bit/.local/lib/python3.6/site-packages (from matplotlib->imgaug) (2.4.7)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/bit/.local/lib/python3.6/site-packages (from matplotlib->imgaug) (1.3.1)
Requirement already satisfied: python-dateutil>=2.1 in /home/bit/.local/lib/python3.6/site-packages (from matplotlib->imgaug) (2.8.1)
Requirement already satisfied: decorator<5,>=4.3 in /home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages (from networkx>=2.0->scikit-image>=0.14.2->imgaug) (4.4.2)
Installing collected packages: Shapely, imgaug
Successfully installed Shapely-1.7.1 imgaug-0.4.0

2.1.7 安装ipython
(MaskRCNN) bit@bit-613:~/MaskRCNN/Mask_RCNN-master$ conda install ipython
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.5.4
  latest version: 4.10.3

Please update conda by running

    $ conda update -n base conda



## Package Plan ##

  environment location: /home/bit/anaconda3/envs/MaskRCNN

  added / updated specs: 
    - ipython


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    pygments-2.9.0             |     pyhd8ed1ab_0         754 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    prompt-toolkit-3.0.19      |     pyha770c72_0         244 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    traitlets-4.3.3            |   py36h9f0ad1d_1         133 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    backports.functools_lru_cache-1.6.4|     pyhd8ed1ab_0           9 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    decorator-5.0.9            |     pyhd8ed1ab_0          11 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    ipython_genutils-0.2.0     |             py_1          21 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    ptyprocess-0.7.0           |     pyhd3deb0d_0          16 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    pickleshare-0.7.5          |          py_1003           9 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    six-1.16.0                 |     pyh6c4a22f_0          14 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    wcwidth-0.2.5              |     pyh9f0ad1d_2          33 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    backcall-0.2.0             |     pyh9f0ad1d_0          13 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    jedi-0.17.2                |   py36h5fab9bb_1         957 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    backports-1.0              |             py_2           4 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    pexpect-4.8.0              |     pyh9f0ad1d_2          47 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    parso-0.7.1                |     pyh9f0ad1d_0          70 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    ipython-7.16.1             |   py36he448a4c_2         1.1 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    ------------------------------------------------------------
                                           Total:         3.4 MB

The following NEW packages will be INSTALLED:

    backcall:                      0.2.0-pyh9f0ad1d_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    backports:                     1.0-py_2              https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    backports.functools_lru_cache: 1.6.4-pyhd8ed1ab_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    decorator:                     5.0.9-pyhd8ed1ab_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    ipython:                       7.16.1-py36he448a4c_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    ipython_genutils:              0.2.0-py_1            https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    jedi:                          0.17.2-py36h5fab9bb_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    parso:                         0.7.1-pyh9f0ad1d_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    pexpect:                       4.8.0-pyh9f0ad1d_2    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    pickleshare:                   0.7.5-py_1003         https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    prompt-toolkit:                3.0.19-pyha770c72_0   https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    ptyprocess:                    0.7.0-pyhd3deb0d_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    pygments:                      2.9.0-pyhd8ed1ab_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    six:                           1.16.0-pyh6c4a22f_0   https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    traitlets:                     4.3.3-py36h9f0ad1d_1  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    wcwidth:                       0.2.5-pyh9f0ad1d_2    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge

Proceed ([y]/n)? y


Downloading and Extracting Packages
pygments-2.9.0       |  754 KB | ####################################### | 100% 
prompt-toolkit-3.0.1 |  244 KB | ####################################### | 100% 
traitlets-4.3.3      |  133 KB | ####################################### | 100% 
backports.functools_ |    9 KB | ####################################### | 100% 
decorator-5.0.9      |   11 KB | ####################################### | 100% 
ipython_genutils-0.2 |   21 KB | ####################################### | 100% 
ptyprocess-0.7.0     |   16 KB | ####################################### | 100% 
pickleshare-0.7.5    |    9 KB | ####################################### | 100% 
six-1.16.0           |   14 KB | ####################################### | 100% 
wcwidth-0.2.5        |   33 KB | ####################################### | 100% 
backcall-0.2.0       |   13 KB | ####################################### | 100% 
jedi-0.17.2          |  957 KB | ####################################### | 100% 
backports-1.0        |    4 KB | ####################################### | 100% 
pexpect-4.8.0        |   47 KB | ####################################### | 100% 
parso-0.7.1          |   70 KB | ####################################### | 100% 
ipython-7.16.1       |  1.1 MB | ####################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(MaskRCNN) bit@bit-613:~/MaskRCNN/Mask_RCNN-master$ 
(MaskRCNN) bit@bit-613:~/MaskRCNN/Mask_RCNN-master$ pip list
Package                       Version             Location
----------------------------- ------------------- ----------------
absl-py                       0.12.0
appdirs                       1.4.4
astor                         0.8.1
backcall                      0.2.0
backports.functools-lru-cache 1.6.4
cached-property               1.5.2
cachetools                    4.2.1
certifi                       2021.5.30
chardet                       4.0.0
cloudpickle                   1.6.0
colorama                      0.4.4
cvpods                        0.1                 /home/bit/cvpods
cycler                        0.10.0
Cython                        0.29.22
decorator                     5.0.9
easydict                      1.9
future                        0.18.2
gast                          0.5.0
google-auth                   1.28.0
google-auth-oauthlib          0.4.3
grpcio                        1.38.1
h5py                          3.1.0
idna                          2.10
imageio                       2.9.0
imgaug                        0.4.0
importlib-metadata            3.7.3
ipython                       7.16.1
ipython-genutils              0.2.0
jedi                          0.17.2
Keras                         2.4.3
Keras-Applications            1.0.8
Keras-Preprocessing           1.1.2
kiwisolver                    1.3.1
Markdown                      3.3.4
matplotlib                    3.3.4
mock                          4.0.3
networkx                      2.5.1
numpy                         1.19.5
oauthlib                      3.1.0
opencv-python                 4.5.3.56
pandas                        1.1.5
parso                         0.7.1
pexpect                       4.8.0
pickleshare                   0.7.5
Pillow                        8.3.1
pip                           21.1.3
portalocker                   2.2.1
prompt-toolkit                3.0.19
protobuf                      3.15.6
ptyprocess                    0.7.0
pyasn1                        0.4.8
pyasn1-modules                0.2.8
pycocotools                   2.0.2
pydot                         1.4.2
Pygments                      2.9.0
pyparsing                     2.4.7
python-dateutil               2.8.1
pytz                          2021.1
PyWavelets                    1.1.1
PyYAML                        5.4.1
requests                      2.25.1
requests-oauthlib             1.3.0
rsa                           4.7.2
scikit-image                  0.17.2
scipy                         1.5.4
seaborn                       0.11.1
setuptools                    49.6.0.post20210108
Shapely                       1.7.1
six                           1.16.0
tabulate                      0.8.9
tensorboard                   1.13.1
tensorboard-plugin-wit        1.8.0
tensorflow-estimator          1.13.0
tensorflow-gpu                1.13.1
termcolor                     1.1.0
tifffile                      2020.9.3
tqdm                          4.59.0
traitlets                     4.3.3
typing-extensions             3.7.4.3
urllib3                       1.26.4
wcwidth                       0.2.5
Werkzeug                      1.0.1
wheel                         0.36.2
zipp                          3.4.1
2.1.8 安装pycocotools

pycocotools从这些存储库之一训练或测试 MS COCO 安装。它们是原始 pycocotools 的分支,修复了 Python3 和 Windows(官方存储库似乎不再活跃)。

COCO API 提供了 Matlab, Python 和 Lua 的 API 接口. 该 API 接口可以提供完整的图像标签数据的加载, parsing 和可视化。在使用coco数据集时会用到这个API,因此需要安装。

  • Linux:https : //github.com/waleedka/coco
  • Windows:https : //github.com/philferriere/cocoapi。您的路径上必须有 Visual C++ 2015 构建工具(有关其他详细信息,请参阅 repo)

下载pycocotools该项目到本地,并解压打开:
在这里插入图片描述

安装方式:

  • For Matlab, add coco/MatlabApi to the Matlab path (OSX/Linux binaries provided)
  • For Python, run “make” under coco/PythonAPI
  • For Lua, run “luarocks make LuaAPI/rocks/coco-scm-1.rockspec” under coco/

For Python, run “make” under coco/PythonAPI,即进入到PythonAPI,并输入make

(MaskRCNN) bit@bit-613:~/MaskRCNN/coco-master$ cd PythonAPI/
(MaskRCNN) bit@bit-613:~/MaskRCNN/coco-master/PythonAPI$ ls
Makefile  pycocoDemo.ipynb  pycocoEvalDemo.ipynb  pycocotools  setup.py
(MaskRCNN) bit@bit-613:~/MaskRCNN/coco-master/PythonAPI$ make
python setup.py build_ext --inplace
Compiling pycocotools/_mask.pyx because it changed.
[1/1] Cythonizing pycocotools/_mask.pyx
/home/bit/.local/lib/python3.6/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/bit/MaskRCNN/coco-master/PythonAPI/pycocotools/_mask.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
running build_ext
building 'pycocotools._mask' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/pycocotools
creating build/common
gcc -pthread -B /home/bit/anaconda3/envs/MaskRCNN/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages/numpy/core/include -I../common -I/home/bit/anaconda3/envs/MaskRCNN/include/python3.6m -c pycocotools/_mask.c -o build/temp.linux-x86_64-3.6/pycocotools/_mask.o -Wno-cpp -Wno-unused-function -std=c99
gcc -pthread -B /home/bit/anaconda3/envs/MaskRCNN/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages/numpy/core/include -I../common -I/home/bit/anaconda3/envs/MaskRCNN/include/python3.6m -c ../common/maskApi.c -o build/temp.linux-x86_64-3.6/../common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
gcc -pthread -shared -B /home/bit/anaconda3/envs/MaskRCNN/compiler_compat -L/home/bit/anaconda3/envs/MaskRCNN/lib -Wl,-rpath=/home/bit/anaconda3/envs/MaskRCNN/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.6/pycocotools/_mask.o build/temp.linux-x86_64-3.6/../common/maskApi.o -o /home/bit/MaskRCNN/coco-master/PythonAPI/pycocotools/_mask.cpython-36m-x86_64-linux-gnu.so
rm -rf build

输入pip install pycocotools,安装成功.

(MaskRCNN) bit@bit-613:~/MaskRCNN/coco-master/PythonAPI$ pip install pycocotools
Requirement already satisfied: pycocotools in /home/bit/.local/lib/python3.6/site-packages (2.0.2)
Requirement already satisfied: cython>=0.27.3 in /home/bit/.local/lib/python3.6/site-packages (from pycocotools) (0.29.22)
Requirement already satisfied: setuptools>=18.0 in /home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages (from pycocotools) (49.6.0.post20210108)
Requirement already satisfied: matplotlib>=2.1.0 in /home/bit/.local/lib/python3.6/site-packages (from pycocotools) (3.3.4)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in /home/bit/.local/lib/python3.6/site-packages (from matplotlib>=2.1.0->pycocotools) (2.4.7)
Requirement already satisfied: python-dateutil>=2.1 in /home/bit/.local/lib/python3.6/site-packages (from matplotlib>=2.1.0->pycocotools) (2.8.1)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/bit/.local/lib/python3.6/site-packages (from matplotlib>=2.1.0->pycocotools) (1.3.1)
Requirement already satisfied: cycler>=0.10 in /home/bit/.local/lib/python3.6/site-packages (from matplotlib>=2.1.0->pycocotools) (0.10.0)
Requirement already satisfied: numpy>=1.15 in /home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages (from matplotlib>=2.1.0->pycocotools) (1.19.5)
Requirement already satisfied: pillow>=6.2.0 in /home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages (from matplotlib>=2.1.0->pycocotools) (8.3.1)
Requirement already satisfied: six in /home/bit/anaconda3/envs/MaskRCNN/lib/python3.6/site-packages (from cycler>=0.10->matplotlib>=2.1.0->pycocotools) (1.16.0)
(MaskRCNN) bit@bit-613:~/MaskRCNN/coco-master/PythonAPI$ 

查询安装的安装包,发现已经成功安装 pycocotools.

(MaskRCNN) bit@bit-613:~/MaskRCNN/coco-master/PythonAPI$ pip list
Package                       Version             Location
----------------------------- ------------------- ----------------
absl-py                       0.12.0
appdirs                       1.4.4
astor                         0.8.1
backcall                      0.2.0
backports.functools-lru-cache 1.6.4
cached-property               1.5.2
cachetools                    4.2.1
certifi                       2021.5.30
chardet                       4.0.0
cloudpickle                   1.6.0
colorama                      0.4.4
cvpods                        0.1                 /home/bit/cvpods
cycler                        0.10.0
Cython                        0.29.22
decorator                     5.0.9
easydict                      1.9
future                        0.18.2
gast                          0.5.0
google-auth                   1.28.0
google-auth-oauthlib          0.4.3
grpcio                        1.38.1
h5py                          3.1.0
idna                          2.10
imageio                       2.9.0
imgaug                        0.4.0
importlib-metadata            3.7.3
ipython                       7.16.1
ipython-genutils              0.2.0
jedi                          0.17.2
Keras                         2.4.3
Keras-Applications            1.0.8
Keras-Preprocessing           1.1.2
kiwisolver                    1.3.1
Markdown                      3.3.4
matplotlib                    3.3.4
mock                          4.0.3
networkx                      2.5.1
numpy                         1.19.5
oauthlib                      3.1.0
opencv-python                 4.5.3.56
pandas                        1.1.5
parso                         0.7.1
pexpect                       4.8.0
pickleshare                   0.7.5
Pillow                        8.3.1
pip                           21.1.3
portalocker                   2.2.1
prompt-toolkit                3.0.19
protobuf                      3.15.6
ptyprocess                    0.7.0
pyasn1                        0.4.8
pyasn1-modules                0.2.8
pycocotools                   2.0.2
pydot                         1.4.2
Pygments                      2.9.0
pyparsing                     2.4.7
python-dateutil               2.8.1
pytz                          2021.1
PyWavelets                    1.1.1
PyYAML                        5.4.1
requests                      2.25.1
requests-oauthlib             1.3.0
rsa                           4.7.2
scikit-image                  0.17.2
scipy                         1.5.4
seaborn                       0.11.1
setuptools                    49.6.0.post20210108
Shapely                       1.7.1
six                           1.16.0
tabulate                      0.8.9
tensorboard                   1.13.1
tensorboard-plugin-wit        1.8.0
tensorflow-estimator          1.13.0
tensorflow-gpu                1.13.1
termcolor                     1.1.0
tifffile                      2020.9.3
tqdm                          4.59.0
traitlets                     4.3.3
typing-extensions             3.7.4.3
urllib3                       1.26.4
wcwidth                       0.2.5
Werkzeug                      1.0.1
wheel                         0.36.2
zipp                          3.4.1
2.1.9 安装nb_conda

一般安装了anaconda会自带jupyter notebook,但是这样启动的notebook运行的是base环境,当我们创建其他虚拟环境时启动notebook是还是运行base环境。

想指定notebook的运行环境需要安装nb_conda,重新启动jupyter notebook之后,就可以在kernel中选择自己需要的虚拟环境。

(MaskRCNN) bit@bit-613:~/MaskRCNN/coco-master/PythonAPI$ conda install nb_conda
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.5.4
  latest version: 4.10.3

Please update conda by running

    $ conda update -n base conda



## Package Plan ##

  environment location: /home/bit/anaconda3/envs/MaskRCNN

  added / updated specs: 
    - nb_conda


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    nb_conda-2.2.1             |   py36h5fab9bb_4          36 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    ipykernel-5.5.5            |   py36hcb3619a_0         166 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    pandocfilters-1.4.2        |             py_1           9 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    nbconvert-6.0.7            |   py36h5fab9bb_3         533 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    jinja2-3.0.1               |     pyhd8ed1ab_0          99 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    pandoc-2.14.1              |       h7f98852_0        12.0 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    send2trash-1.7.1           |     pyhd8ed1ab_0          17 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    typing_extensions-3.10.0.0 |     pyha770c72_0          28 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    cffi-1.14.6                |   py36hc120d54_0         224 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    async_generator-1.10       |             py_0          18 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    webencodings-0.5.1         |             py_1          12 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    nbclient-0.5.3             |     pyhd8ed1ab_0          67 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    mistune-0.8.4              |py36h8f6f2f9_1004          54 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    markupsafe-2.0.1           |   py36h8f6f2f9_0          22 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    attrs-21.2.0               |     pyhd8ed1ab_0          44 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    testpath-0.5.0             |     pyhd8ed1ab_0          86 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    pyzmq-22.1.0               |   py36h7068817_0         528 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    argon2-cffi-20.1.0         |   py36h8f6f2f9_2          47 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    prometheus_client-0.11.0   |     pyhd8ed1ab_0          46 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    entrypoints-0.3            |  pyhd8ed1ab_1003           8 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    importlib-metadata-4.6.1   |   py36h5fab9bb_0          31 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    python-dateutil-2.8.2      |     pyhd8ed1ab_0         240 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    jupyter_core-4.7.1         |   py36h5fab9bb_0          72 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    bleach-3.3.1               |     pyhd8ed1ab_0         111 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    packaging-21.0             |     pyhd8ed1ab_0          35 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    terminado-0.10.1           |   py36h5fab9bb_0          26 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    nest-asyncio-1.5.1         |     pyhd8ed1ab_0           9 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    defusedxml-0.7.1           |     pyhd8ed1ab_0          23 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    nbformat-5.1.3             |     pyhd8ed1ab_0          47 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    libsodium-1.0.18           |       h36c2ea0_1         366 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    jupyterlab_pygments-0.1.2  |     pyh9f0ad1d_0           8 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    notebook-6.3.0             |   py36h5fab9bb_0         6.3 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    zeromq-4.3.4               |       h9c3ff4c_0         352 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    zipp-3.5.0                 |     pyhd8ed1ab_0          12 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    pyrsistent-0.17.3          |   py36h8f6f2f9_2          89 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    tornado-6.1                |   py36h8f6f2f9_1         643 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    jsonschema-3.2.0           |     pyhd8ed1ab_3          45 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    jupyter_client-6.1.12      |     pyhd8ed1ab_0          79 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    nb_conda_kernels-2.3.1     |   py36h5fab9bb_0          27 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    ------------------------------------------------------------
                                           Total:        22.5 MB

The following NEW packages will be INSTALLED:

    argon2-cffi:         20.1.0-py36h8f6f2f9_2   https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    async_generator:     1.10-py_0               https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    attrs:               21.2.0-pyhd8ed1ab_0     https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    bleach:              3.3.1-pyhd8ed1ab_0      https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    cffi:                1.14.6-py36hc120d54_0   https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    defusedxml:          0.7.1-pyhd8ed1ab_0      https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    entrypoints:         0.3-pyhd8ed1ab_1003     https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    importlib-metadata:  4.6.1-py36h5fab9bb_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    ipykernel:           5.5.5-py36hcb3619a_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    jinja2:              3.0.1-pyhd8ed1ab_0      https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    jsonschema:          3.2.0-pyhd8ed1ab_3      https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    jupyter_client:      6.1.12-pyhd8ed1ab_0     https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    jupyter_core:        4.7.1-py36h5fab9bb_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    jupyterlab_pygments: 0.1.2-pyh9f0ad1d_0      https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    libsodium:           1.0.18-h36c2ea0_1       https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    markupsafe:          2.0.1-py36h8f6f2f9_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    mistune:             0.8.4-py36h8f6f2f9_1004 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    nb_conda:            2.2.1-py36h5fab9bb_4    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    nb_conda_kernels:    2.3.1-py36h5fab9bb_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    nbclient:            0.5.3-pyhd8ed1ab_0      https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    nbconvert:           6.0.7-py36h5fab9bb_3    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    nbformat:            5.1.3-pyhd8ed1ab_0      https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    nest-asyncio:        1.5.1-pyhd8ed1ab_0      https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    notebook:            6.3.0-py36h5fab9bb_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    packaging:           21.0-pyhd8ed1ab_0       https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    pandoc:              2.14.1-h7f98852_0       https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    pandocfilters:       1.4.2-py_1              https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    prometheus_client:   0.11.0-pyhd8ed1ab_0     https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    pycparser:           2.20-pyh9f0ad1d_2       https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    pyparsing:           2.4.7-pyh9f0ad1d_0      https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    pyrsistent:          0.17.3-py36h8f6f2f9_2   https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    python-dateutil:     2.8.2-pyhd8ed1ab_0      https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    pyzmq:               22.1.0-py36h7068817_0   https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    send2trash:          1.7.1-pyhd8ed1ab_0      https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    terminado:           0.10.1-py36h5fab9bb_0   https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    testpath:            0.5.0-pyhd8ed1ab_0      https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    tornado:             6.1-py36h8f6f2f9_1      https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    typing_extensions:   3.10.0.0-pyha770c72_0   https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    webencodings:        0.5.1-py_1              https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    zeromq:              4.3.4-h9c3ff4c_0        https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    zipp:                3.5.0-pyhd8ed1ab_0      https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge

Proceed ([y]/n)? y


Downloading and Extracting Packages
nb_conda-2.2.1       |   36 KB | ########################################################## | 100% 
ipykernel-5.5.5      |  166 KB | ########################################################## | 100% 
pandocfilters-1.4.2  |    9 KB | ########################################################## | 100% 
nbconvert-6.0.7      |  533 KB | ########################################################## | 100% 
jinja2-3.0.1         |   99 KB | ########################################################## | 100% 
pandoc-2.14.1        | 12.0 MB | ########################################################## | 100% 
send2trash-1.7.1     |   17 KB | ########################################################## | 100% 
typing_extensions-3. |   28 KB | ########################################################## | 100% 
cffi-1.14.6          |  224 KB | ########################################################## | 100% 
async_generator-1.10 |   18 KB | ########################################################## | 100% 
webencodings-0.5.1   |   12 KB | ########################################################## | 100% 
nbclient-0.5.3       |   67 KB | ########################################################## | 100% 
mistune-0.8.4        |   54 KB | ########################################################## | 100% 
markupsafe-2.0.1     |   22 KB | ########################################################## | 100% 
attrs-21.2.0         |   44 KB | ########################################################## | 100% 
testpath-0.5.0       |   86 KB | ########################################################## | 100% 
pyzmq-22.1.0         |  528 KB | ########################################################## | 100% 
argon2-cffi-20.1.0   |   47 KB | ########################################################## | 100% 
prometheus_client-0. |   46 KB | ########################################################## | 100% 
entrypoints-0.3      |    8 KB | ########################################################## | 100% 
importlib-metadata-4 |   31 KB | ########################################################## | 100% 
python-dateutil-2.8. |  240 KB | ########################################################## | 100% 
jupyter_core-4.7.1   |   72 KB | ########################################################## | 100% 
bleach-3.3.1         |  111 KB | ########################################################## | 100% 
packaging-21.0       |   35 KB | ########################################################## | 100% 
terminado-0.10.1     |   26 KB | ########################################################## | 100% 
nest-asyncio-1.5.1   |    9 KB | ########################################################## | 100% 
defusedxml-0.7.1     |   23 KB | ########################################################## | 100% 
nbformat-5.1.3       |   47 KB | ########################################################## | 100% 
libsodium-1.0.18     |  366 KB | ########################################################## | 100% 
jupyterlab_pygments- |    8 KB | ########################################################## | 100% 
notebook-6.3.0       |  6.3 MB | ########################################################## | 100% 
zeromq-4.3.4         |  352 KB | ########################################################## | 100% 
zipp-3.5.0           |   12 KB | ########################################################## | 100% 
pyrsistent-0.17.3    |   89 KB | ########################################################## | 100% 
tornado-6.1          |  643 KB | ########################################################## | 100% 
jsonschema-3.2.0     |   45 KB | ########################################################## | 100% 
jupyter_client-6.1.1 |   79 KB | ########################################################## | 100% 
nb_conda_kernels-2.3 |   27 KB | ########################################################## | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: / Enabling nb_conda_kernels...
CONDA_PREFIX: /home/bit/anaconda3/envs/MaskRCNN
Status: enabled

\ + /home/bit/anaconda3/envs/MaskRCNN/bin/jupyter-nbextension enable nb_conda --py --sys-prefix
Config option `kernel_spec_manager_class` not recognized by `EnableNBExtensionApp`.
Enabling notebook extension nb_conda/main...
      - Validating: OK
Enabling tree extension nb_conda/tree...
      - Validating: OK
+ /home/bit/anaconda3/envs/MaskRCNN/bin/jupyter-serverextension enable nb_conda --py --sys-prefix
Config option `kernel_spec_manager_class` not recognized by `EnableServerExtensionApp`.
Enabling: nb_conda
- Writing config: /home/bit/anaconda3/envs/MaskRCNN/etc/jupyter
    - Validating...
      nb_conda 2.2.1 OK

done

三、下载数据集

3.1 下载数据集和权重文件

3.2 构建数据集

创建数据集文件夹,并将数据集放入:
在这里插入图片描述

四、网络训练

五、问题解决

5.1 Keras requires TensorFlow 2.2 or higher.

 pip install keras==2.0.8

5.2 AttributeError: ‘str’ object has no attribute ‘decode’

卸载原来的h5py模块,安装2.10版本

pip install h5py==2.10 -i https://pypi.tuna.tsinghua.edu.cn/simple/

5.3 ModuleNotFoundError: No module named ‘mrcnn’

python setup.py install

5.4 在TensorFlow中屏蔽warning的方式

https://www.yht7.com/news/30396

https://www.freesion.com/article/5863338313/
https://blog.csdn.net/qq_29462849/article/details/81037343
https://blog.csdn.net/u012746060/article/details/82143285

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值