Mask_RCNN icon indicating copy to clipboard operation
Mask_RCNN copied to clipboard

AttributeError: module 'mrcnn.model' has no attribute 'data_generator'

Open omdxp opened this issue 4 years ago • 7 comments

There is no attribute in model.py for data_generator in mrcnn for tensorflow 2.

omdxp avatar Apr 14 '20 16:04 omdxp

Hi @Omar-Belghaouti , did you find any solution for 'AttributeError: module 'mrcnn.model' has no attribute 'data_generator'' ?

ZeynepRuveyda avatar Mar 30 '21 09:03 ZeynepRuveyda

Hi @Omar-Belghaouti , did you find any solution for 'AttributeError: module 'mrcnn.model' has no attribute 'data_generator'' ?

@ZeynepRuveyda sadly no, I stopped using mrcnn with tensorflow 2, had to fallback to tensorflow 1

omdxp avatar Mar 30 '21 09:03 omdxp

Thank you!

ZeynepRuveyda avatar Mar 31 '21 07:03 ZeynepRuveyda

I adopted the following version first https://github.com/leekunhee/Mask_RCNN/tree/tensorflow2.0 and ran inspect_data.ipynb. But encountered the same problem. There is no data_generator function in model.py. So I just used the original version https://github.com/matterport/Mask_RCNN (it has such a function but it is for tensorflow 1.X and it cannot run train_shapes.ipynb successfully.) and it works!

bfhaha avatar Jun 13 '21 15:06 bfhaha

I am having this issue too, and really don't want tot switch to tf1! Has anyone found a solution to this still using tf2?

syorke24 avatar Jan 13 '22 11:01 syorke24

I am having this issue too, and really don't want tot switch to tf1! Has anyone found a solution to this still using tf2?

I, like bfhaha, am using this version: https://github.com/leekunhee/Mask_RCNN/tree/tensorflow2.0

There is a DataGenerator instead of data_generator in model.py.

TStelzer86 avatar Jan 31 '22 10:01 TStelzer86

While it is true, that the updated versions of the https://github.com/matterport/Mask_RCNN Have the class DataGenerator it throws the following issue

image

As of now, I am still very new to the field and I am simply trying to recreate the balloon example. The aforementioned error occurred calling the inspect_balloon_data notebook.

Any explanation as to why DataGenerator is not recognized as an iterator?

Malte-Weber avatar Apr 28 '22 09:04 Malte-Weber

@Weber-AILand, the new DataGenerator object is indeed not an iterator, but you can easily fix this code by changing next(g) to next(iter(g)) for both conditions of the if ... else statement. This solved the issue for me.

dluks avatar Sep 30 '22 11:09 dluks