Skip to content

Commit 8db66ce

Browse files
committed
Fix import of Model (not in tf.keras.layers)
1 parent 97da50f commit 8db66ce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plasma/models/tcn.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from tensorflow.keras import optimizers
44
from tensorflow.keras.layers import (
55
Activation, Lambda, Conv1D, SpatialDropout1D, Dense, BatchNormalization,
6-
Input, Model, Layer
6+
Input, Layer
77
)
88

99

@@ -202,7 +202,7 @@ def get_opt():
202202
x = Dense(num_classes)(x)
203203
x = Activation('softmax')(x)
204204
output_layer = x
205-
model = Model(input_layer, output_layer)
205+
model = tf.keras.Model(input_layer, output_layer)
206206

207207
# https://github.com/keras-team/keras/pull/11373
208208
# It's now in Keras@master but still not available with pip.
@@ -226,7 +226,7 @@ def accuracy(y_true, y_pred):
226226
x = Dense(1)(x)
227227
x = Activation('linear')(x)
228228
output_layer = x
229-
model = Model(input_layer, output_layer)
229+
model = tf.keras.Model(input_layer, output_layer)
230230
model.compile(get_opt(), loss='mean_squared_error')
231231
print('model.x = {}'.format(input_layer.shape))
232232
print('model.y = {}'.format(output_layer.shape))

0 commit comments

Comments
 (0)