I am working with python 3.9, tensorflow 2.7.0 with a modified version of Mask RCNN https://github.com/leekunhee/Mask_RCNN/blob/tensorflow2.0/mrcnn). I am working with tensorflow .keras and specifically import
import tensorflow as tf
from tensorflow.python import keras
from tensorflow.python.keras import backend as K
from tensorflow.python.keras import layers as KL
from tensorflow.python.keras import utils as KU
from tensorflow.python.eager import context
from tensorflow.python.keras import initializers as KI#nuevo
from tensorflow.python.keras import engine as KE
from tensorflow.python.keras import models as KM
from tensorflow.keras.optimizers import SGD
I call this module in this code
`optimizer = SGD(lr=learning_rate, momentum=momentum, clipnorm=self.config.GRADIENT_CLIP_NORM)`
and get this error
~/work/model.py in compile(self, learning_rate, momentum)
2234 """
2235
-> 2236 # Optimizer object
2237 optimizer = SGD(
2238 lr=learning_rate, momentum=momentum,
AttributeError: module 'tensorflow.python.keras.optimizers' has no attribute 'SGD'
I have tried calling tensforflow.keras.optimizers.SGD
or tensorflow.python.keras.optimizers.SGD
instead but nothing seems to work.
I am working on a jupyter notebook in IBM Watson Studio
Thanks!