matterport / Mask_RCNN

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

Error using Mask RCNN: Lambda Layer: Defining Model #2328

Open YashRunwal opened 4 years ago

YashRunwal commented 4 years ago

Hello guys,

I am currently using Matterport Mask RCNN to train on custom dataset. I have annotated my images using labelme and then made respective changes to the Dataset Class. As far as I can tell, the changes are working.

When I try to run the following command, I get an error:


MODEL_DIR = 'logs'

model = modellib.MaskRCNN(mode="training", config=config,
                          model_dir=MODEL_DIR)

Error:

Lambda layers are not well suited to stateful computation; instead, writing a
subclassed Layer is the recommend way to define layers with
Variables.

I am using following versions: Tensorflow: 2.2.0 Keras: 2.4.3

I would really appreciate your help with this.

Regards, Yash

Jeharul-Hussain commented 4 years ago

Hi Yash,

Try using Tensorflow 1.15 Keras = 2.3

Tensorflow versions > 2 still do not support few of the libraries which Mask RCNN deals with.

Also make sure that you supply appropriate values to the config

nataliameira commented 3 years ago

Hi @YashRunwal ! Were you able to solve this problem?

YashRunwal commented 3 years ago

@nataliameira Yes I downgraded the tensorflow version as suggested by @Jeharul-Hussain

Hitesh319 commented 1 year ago

@nataliameira Yes I downgraded the tensorflow version as suggested by @Jeharul-Hussain

Could you tell how to downgrade tensorflow version?

nataliameira commented 1 year ago

Hey @Hitesh319 Hey I trained my model and visualized the data. My training was held on June 3, 2021. I used:

pip uninstall keras-nightly
pip uninstall -y tensorflow
h5py==2.10.0
tensorflow==1.15
tensorflow-gpu==1.15.0
keras==2.1