----> 6 from mrcnn.model import MaskRCNN
/usr/local/lib/python3.7/dist-packages/mrcnn/model.py in () 253 254 --> 255 class ProposalLayer(KE.Layer): 256 """Receives anchor scores and selects a subset to pass as proposals 257 to the second stage. Filtering is done based on anchor scores and
AttributeError: module 'keras.engine' has no attribute 'Layer'
In essence, many of the import and attribute errors from keras come from the fact that keras changes its imports depending on whether you are using a CPU or using a GPU or ASIC. Some of the engine classes don’t get imported in every case. Instead, use from keras.layers import Layer and use that layer class in place of the one from the engine.
Keras layers API. Layers are the basic building blocks of neural networks in Keras. A layer consists of a tensor-in tensor-out computation function (the layer's call method) and some state, held in TensorFlow variables (the layer's weights ). A Layer instance is callable, much like a function:
Well, you are getting this error because of the compatibility issue between Tensorflow and Keras. You see under the hood Keras uses Tensorflow for various matrix manipulation.
module 'keras.engine.saving' has no attribute 'load_weights_from_hdf5_group_by_name' For lines where you are using Layers like ProposalLayer (KE.Layer)
This isn’t strictly a duplicate, but a similar question is found here: AttributeError: module 'keras.engine' has no attribute 'input_layer'
In essence, many of the import and attribute errors from keras come from the fact that keras changes its imports depending on whether you are using a CPU or using a GPU or ASIC. Some of the engine classes don’t get imported in every case.
Instead, use from keras.layers import Layer
and use that layer class in place of the one from the engine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With