Open naserpiltan opened 6 years ago
you can try:
# import coco
from samples.coco import coco
@HC-2016
thank you so much
I fixed the problem with your workround.
thank's again
@HC-2016 Thank you! It's works fine!
its not working for me :(
import cv2 import numpy as np import os import sys import imageio from mrcnn import utils from mrcnn import model as modellib
ROOT_DIR = os.path.abspath('../') MODEL_DIR = os.path.join(ROOT_DIR, "logs") sys.path.append(os.path.join(ROOT_DIR,'coco/')) import coco from coco import coco COCO_MODEL_PATH = os.path.join(ROOT_DIR, "mask_rcnn_coco.h5")
I encountered the same problem. Tried the suggestion here but didn't work. So I simply copied and pasted the following code into my .py files, hope this helps.
from mrcnn.config import Config class CocoConfig(Config): """Configuration for training on MS COCO. Derives from the base Config class and overrides values specific to the COCO dataset. """
NAME = "coco"
# We use a GPU with 12GB memory, which can fit two images.
# Adjust down if you use a smaller GPU.
IMAGES_PER_GPU = 2
# Uncomment to train on 8 GPUs (default is 1)
# GPU_COUNT = 8
# Number of classes (including background)
NUM_CLASSES = 1 + 80 # COCO has 80 classes
you can try:
# import coco from samples.coco import coco
@ HC-2016
I tried this command but it says No module named 'samples'
Please help.
you can try:
# import coco from samples.coco import coco
when you use it from samples.coco import coco. it gives you error No module named samples
I may be a bit late, but I just encountered the same issue. It was solved by:
config = InferenceConfig() config.display()
I encountered the same problem. Tried the suggestion here but didn't work. So I simply copied and pasted the following code into my .py files, hope this helps.
from mrcnn.config import Config class CocoConfig(Config): """Configuration for training on MS COCO. Derives from the base Config class and overrides values specific to the COCO dataset. """
Give the configuration a recognizable name
NAME = "coco"
# We use a GPU with 12GB memory, which can fit two images. # Adjust down if you use a smaller GPU. IMAGES_PER_GPU = 2 # Uncomment to train on 8 GPUs (default is 1) # GPU_COUNT = 8 # Number of classes (including background) NUM_CLASSES = 1 + 80 # COCO has 80 classes
Thanks @dxoco ! your workaround was the only working for me.
Thanks, @dxoco!!! It worked......
@dxoco Could you help me with my problem below:
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-14-815378d5aae5> in <module>
29 sys.path.append(os.path.join(ROOT_DIR, "samples/coco")) # To find local version
30 # import coco
---> 31 from samples.coco import coco
32 # from pycocotools.coco import COCO
33
ModuleNotFoundError: No module named 'samples.coco'
---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the
"Open Examples" button below.
https://stackoverflow.com/questions/64507647/modulenotfounderror-no-module-named-samples-coco
I may be a bit late, but I just encountered the same issue. It was solved by:
1. from mrcnn.config import Config and 2. setting: class InferenceConfig(Config): GPU_COUNT = 1 IMAGES_PER_GPU = 1
config = InferenceConfig() config.display()
I encountered the same problem. Tried the suggestion here but didn't work. So I simply copied and pasted the following code into my .py files, hope this helps. from mrcnn.config import Config class CocoConfig(Config): """Configuration for training on MS COCO. Derives from the base Config class and overrides values specific to the COCO dataset. """
Give the configuration a recognizable name
NAME = "coco"
# We use a GPU with 12GB memory, which can fit two images. # Adjust down if you use a smaller GPU. IMAGES_PER_GPU = 2 # Uncomment to train on 8 GPUs (default is 1) # GPU_COUNT = 8 # Number of classes (including background) NUM_CLASSES = 1 + 80 # COCO has 80 classes
I tried this way and worked with this issue, but this solution might cause #709 . Did anyone have overcome #709 ?
[edited]
I solved by copy coco.py at colab
!cp samples/coco/coco.py .
then removed this column
sys.path.append(os.path.join(ROOT_DIR, "samples/coco/"))
I want to use Mask-RCNN demo.py in my jupyter notebook but when i ran the the demo code , i faced such a problem
I used from this https://github.com/matterport/Mask_RCNN/issues/526 workround but it has not any correct code and i can not solve my problem can any body help me?? thank's