Mask_rcnn: nucleus--train StopIteration

Created on 5 May 2018  ·  6Comments  ·  Source: matterport/Mask_RCNN

Traceback (most recent call last):
File "samples/nucleus/nucleus.py", line 487, in
train(model, args.dataset, args.subset)
File "samples/nucleus/nucleus.py", line 259, in train
dataset_train.load_nucleus(dataset_dir, subset)
File "samples/nucleus/nucleus.py", line 209, in load_nucleus
image_ids = next(os.walk(dataset_dir))[1]
StopIteration

thanks very much

Most helpful comment

Have sloved:use”image_ids = os.listdir(dataset_dir)”replace” image_ids = next(os.walk(dataset_dir))[1]”

All 6 comments

Have sloved:use”image_ids = os.listdir(dataset_dir)”replace” image_ids = next(os.walk(dataset_dir))[1]”

I am getting the error message, even in the code image_ids = next(os.walk(dataset_dir))[1]”

Any suggestions please

--dataset arg should point to one level above stage1_train directory since "stage1_train/" gets appended

I am getting the error message, even in the code image_ids = next(os.walk(dataset_dir))[1]”

Any suggestions please

Did you fix it?

``---------------------------------------------------------------------------
StopIteration Traceback (most recent call last)
in
6 # val: loads validation images from stage1_train. For a list
7 # of validation images see nucleus.py
----> 8 dataset.load_nucleus(DATASET_DIR, subset="train")
9
10 # Must call before using the dataset

~\Desktop\DataSets\CNN\rt-mrcnn-master\samples\nucleus\nucleus.py in load_nucleus(self, dataset_dir, subset)
207 else:
208 # Get image ids from directory names
--> 209 image_ids = next(os.walk(dataset_dir))[1]
210 if subset == "train":
211 image_ids = list(set(image_ids) - set(VAL_IMAGE_IDS))

StopIteration:

same error plzzz help (((

I solved the problem for me by using an absolute instead of a relative path.

train --dataset=/home/X/PycharmProjects/Mask_RCNN/datasets/nucleus --subset=stage1_train --weights=imagenet
Was this page helpful?
0 / 5 - 0 ratings