Help me! Beginner here. when I first run the MaskRCNN demo.py - I face at lot of module no found errors; I solved most of them and I am a bit stuck here! I tried every resolution I could find online even reinstalled the pycocotools but it seems that anything I do doesn't fix it. Please help!
import mrcnn.model as modellib
import os
import sys
import random
import math
import numpy as np
import skimage.io
import matplotlib
import matplotlib.pyplot as plt
​
ROOT_DIR = os.path.abspath("../")
​
sys.path.append(ROOT_DIR) # To find local version of the library
from mrcnn import utils
import mrcnn.model as modellib
from mrcnn import visualize
sys.path.append(os.path.join(ROOT_DIR, "samplescoco/")) # To find local version
import coco
​
%matplotlib inline
​
MODEL_DIR = os.path.join(ROOT_DIR, "logs")
​
COCO_MODEL_PATH = os.path.join(ROOT_DIR, "mask_rcnn_coco.h5")
if not os.path.exists(COCO_MODEL_PATH):
utils.download_trained_weights(COCO_MODEL_PATH)
​
ModuleNotFoundError Traceback (most recent call last)
18 # Import COCO config
19 sys.path.append(os.path.join(ROOT_DIR, "samplescoco/")) # To find local version
---> 20 import coco
21
22 get_ipython().run_line_magic('matplotlib', 'inline')
f:AnacondaMask_RCNNsamples/cocococo.py in
40 # If the PR is merged then use the original repo.
41 # Note: Edit PythonAPI/Makefile and replace "python" with "python3".
---> 42 from pycocotools.coco import COCO
43 from pycocotools.cocoeval import COCOeval
44 from pycocotools import mask as maskUtils
ModuleNotFoundError: No module named 'pycocotools'
because your path is wrong. Give correct path to the root directory and log files and coco weight file.
AttributeError Traceback (most recent call last)
----> 1 class InferenceConfig(coco.CocoConfig):
2 # Set batch size to 1 since we'll be running inference on
3 # one image at a time. Batch size = GPU_COUNT * IMAGES_PER_GPU
4 GPU_COUNT = 1
5 IMAGES_PER_GPU = 1
AttributeError: module 'coco' has no attribute 'CocoConfig'
try
pip install -U scikit-image
pip install -U cython
pip install git+https://github.com/philferriere/cocoapi.git#egg=pycocotools^&subdirectory=PythonAPI
from tokenizer.ptbtokenizer import PTBTokenizer
ModuleNotFoundError: No module named 'tokenizer.ptbtokenizer'
for windows / mrcnn
try
pip install -U scikit-image
pip install -U cython
pip uninstall numpy
pip install numpy==1.8
pip install pycocotools-windows
Most helpful comment
try
pip install -U scikit-image
pip install -U cython
pip install git+https://github.com/philferriere/cocoapi.git#egg=pycocotools^&subdirectory=PythonAPI