matterport / Mask_RCNN

Mask R-CNN for object detection and instance segmentation on Keras and TensorFlow
Other
24.36k stars 11.65k forks source link

KeyError: 'names' #2915

Open NazriHariz opened 1 year ago

NazriHariz commented 1 year ago

i am facing this error when i'm trying to run my train(model). I am sure there is no error in my syntax. Please help me!

KeyError Traceback (most recent call last)

in ----> 3 train(model) in train(model) 3 # Training dataset. 4 dataset_train = CustomDataset() ----> 5 dataset_train.load_custom("C:\\Users\\User\\OneDrive - Universiti Teknologi MARA\\FYP\\skin burn\\MaskRCNN-main\\Dataset", "train") 6 dataset_train.prepare() 7 in load_custom(self, dataset_dir, subset) 45 # shape_attributes (see json format above) 46 polygons = [r['shape_attributes'] for r in a['regions']] ---> 47 objects = [s['region_attributes']['names' for s in a['regions']] 48 print("objects:",objects) 49 #name_dict = {"laptop": 1,"tab": 2,"phone": 3} in (.0) 45 # shape_attributes (see json format above) 46 polygons = [r['shape_attributes'] for r in a['regions']] ---> 47 objects = [s['region_attributes']['names'] for s in a['regions']] 48 print("objects:",objects) 49 #name_dict = {"laptop": 1,"tab": 2,"phone": 3} KeyError: 'names'
userwatch commented 3 weeks ago

Hello @NazriHariz I have same error now. Did you solve this error?

NazriHariz commented 3 weeks ago

Hai @sila533 , if im not mistaken the error coming from the annotation. you might wanna check your json files how its construct. Hope this helps.

userwatch commented 3 weeks ago

Hi @NazriHariz , Thank you very much for reply. Which versions did you use ? I use: PYTHON 3.8.0 TENSORFLOW 2.4.0 KERAS 2.4.3

NazriHariz commented 3 weeks ago

Hi @NazriHariz , Thank you very much for reply. Which versions did you use ? I use: PYTHON 3.8.0 TENSORFLOW 2.4.0 KERAS 2.4.3

I used an old version. PYTHON 3.6.X TENSORFLOW 1.X

userwatch commented 3 weeks ago

1.x for colab does not work. I'm trying conda right now. Did you run it in colab? Can you share it with me?