In the demo notebook, the line below
model.load_weights(COCO_MODEL_PATH, by_name=True)
is used to load weights, this no longer works in Keras. I tried with the latest github pull, as well as the pip default install on ubuntu 16.04. I had to revert to Keras 2.0.8 specifically to get this to work. Looks like model.load_weights and model.save_weights is the way going forward in keras.
if by_name:
topology.load_weights_from_hdf5_group_by_name(f, layers)
else:
topology.load_weights_from_hdf5_group(f, layers)
I made pull request. Until it merged, You can replace topology with saving. Topology engine will be deprecated :)
I made the change still I'm getting error.
Loading weights /home/pratibha/dl_semseg/Mask_RCNN/mask_rcnn_coco.h5
Traceback (most recent call last):
File "balloon.py", line 353, in
"mrcnn_bbox", "mrcnn_mask"])
File "/home/pratibha/anaconda3/lib/python3.5/site-packages/mask_rcnn-2.1-py3.5.egg/mrcnn/model.py", line 2119, in load_weights
AttributeError: module 'keras.engine.topology' has no attribute 'load_weights_from_hdf5_group_by_name'
@PratibhaT After changing that, You have to rollback your ipynb file to original ipynb
@gtgalone You have to rollback your ipynb file to original ipynb?How to do the specific operation?
@tanzf
git checkout -- . on your terminal to remove all changes.(or remove Mask_RCNN directory and then clone this repo again)mrcnn/model.py file.topology with saving.mrcnn/model.py file.sample/demo.ipynb(or something) on jupyter notebook.@tanzf
After changing the model.py file don't forget to reinstall the maskrcnn package using python3 setup.py install that should make it work I used the same instructions mentioned by @gtgalone
@gtgalone @yshvrdhn thank you..it worked...but i'm not able to run it on my gpu...in config.py it says that put GPU_COUNT=1 for training on cpu, So, changed that to 2, and it raised an error. Which files did you change to run training on gpu.
@PratibhaT Well GPU_COUNT signifies the number of GPUs you have available i.e. if you have one let it be 1.
@yshvrdhn thank you. I figured out that my tensorflow-gpu was not installed properly that is why training was running on cpu.
excellent
verified working, so closing.
I've an issue when I applied your code on gray-scale images (2D dimesion) . Please I need help
Thanks
Most helpful comment
@tanzf
git checkout -- .on your terminal to remove all changes.(or remove Mask_RCNN directory and then clone this repo again)mrcnn/model.pyfile.topologywithsaving.mrcnn/model.pyfile.sample/demo.ipynb(or something) on jupyter notebook.