segmentation_models
segmentation_models copied to clipboard
Keras layers to Tensorflow keras layers - help!
Wonderful repository! Thanks!
Using -> TF 1.15
I wanted to optimize this repository using the tensorflow model optimization techniques but I am having a challenge.
After creating the model as below
# define network parameters
n_classes = 1 if len(CLASSES) == 1 else (len(CLASSES) + 1) # case for binary and multiclass segmentation
activation = 'sigmoid' if n_classes == 1 else 'softmax'
#create model
model = sm.Unet(BACKBONE, classes=n_classes, activation=activation)
I checked the type of the model type(model)
-> keras.engine.training.Model
But I need the model type to be -> tensorflow.python.keras.engine.training.Model
Does someone have an idea how to convert into tensorflow.python.keras.engine.training.Model
?
Have you tried :
import segmentation_models as sm
sm.set_framework('tf.keras')
?