matterport / Mask_RCNN

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

AttributeError: 'NoneType' object has no attribute 'lower' #709

Open AllanZuo opened 6 years ago

AllanZuo commented 6 years ago

I just try the demo;but there is an error when compiling it.I don't know how to fix it.

Below is the detailed informaiton: Traceback (most recent call last): File "D:/Program/mask_rcnn/my_test1.py", line 43, in

model = modellib.MaskRCNN(mode="inference", config=config, model_dir="D:/Program/mask_rcnn/logs/")

File "D:\Program\mask_rcnn\build\lib\mrcnn\model.py", line 1831, in init self.set_log_dir()

File "D:\Program\mask_rcnn\build\lib\mrcnn\model.py", line 2256, in set_log_dir self.config.NAME.lower(), now)) AttributeError: 'NoneType' object has no attribute 'lower'

engineer1109 commented 6 years ago

Use Ubuntu and Python3.5-3.6

AllanZuo commented 6 years ago

@engineer1109 Thanks. May be that will work. Is there still any chance to fix this issue in win10?

engineer1109 commented 6 years ago

I don't know. The code is made for Linux so-compiler not windows dll-compiler.

123liluky commented 6 years ago

I run into the error before and I solved it by setting NAME='coco' instead of NAME='' in config.py.

Benito2204 commented 4 years ago

@ 123liluky

If you don't mind, can you elaborate your answer?

I`m still not getting through it.

Benito2204 commented 4 years ago

@AllanZuo

Did you resolve this issue?

sourav1122 commented 4 years ago

facing same issue somebody please help!

GSacchetti commented 4 years ago

Hello, I am facing the same issue when training on my own dataset, Could someone address this problem please ?

jmwill86 commented 4 years ago

You get this error if you dont use the correct config class when inheriting your config. Using the training Config class from mrcnn.config for example class InferenceConfig(Config): instead of a coco config class InferenceConfig(coco.CocoConfig): for example

sahaj432 commented 4 years ago

@jmwill86 is there any solution for it ? Please help!!!

ghost commented 4 years ago

@jmwill86 as @123liluky have mentioned above you have to set NAME='coco' instead of NAME= None in config.py. You may also write a subclass and override the Name variable from there.

gbinduo commented 3 years ago

I have the same problem. Have you solved this problem?

Mariac-db commented 3 years ago

I had the same problem I solved eliminating the Null and None of my data.

beybars1 commented 3 years ago

Hi, I guess, I am a bit late but update this code:

from mrcnn.config import Config class InferenceConfig(Config): GPU_COUNT = 1 IMAGES_PER_GPU = 1 NAME = 'coco' config = InferenceConfig() config.display()

The variable NAME is updated to 'coco'

aztac1 commented 2 years ago

In my case, I changed " NAME = None " into " NAME = '' " in "Config" class of "config.py", and it worked! The environment is window 10, with tensorflow 2.4.0(same version with tensorflow-gpu) and torch 1.7.1+cu110.

Nazaroadi commented 2 years ago

hey did ever have the a keras.engine problem?it is about "layer" or something and can u tell me ur envs

In my case, I changed " NAME = None " into " NAME = '' " in "Config" class of "config.py", and it worked! The environment is window 10, with tensorflow 2.4.0(same version with tensorflow-gpu) and torch 1.7.1+cu110.