Spaces:
Sleeping
Sleeping
Added custom_objects when loading the model
Browse files
app.py
CHANGED
|
@@ -6,10 +6,12 @@ import tensorflow as tf
|
|
| 6 |
|
| 7 |
model_pb_path = "./4-15_ViT-B16_Lung3_v1/saved_model.pb"
|
| 8 |
model_keras_path = "model.keras"
|
| 9 |
-
|
| 10 |
-
model.
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
| 13 |
|
| 14 |
# Define preprocessing function
|
| 15 |
def preprocess_image(image):
|
|
|
|
| 6 |
|
| 7 |
model_pb_path = "./4-15_ViT-B16_Lung3_v1/saved_model.pb"
|
| 8 |
model_keras_path = "model.keras"
|
| 9 |
+
|
| 10 |
+
model = tf.keras.models.load_model(model_keras_path, custom_objects={'KerasLayer': hub.KerasLayer})
|
| 11 |
+
|
| 12 |
+
# model.compile(optimizer=Adam(learning_rate=0.0001),
|
| 13 |
+
# loss='binary_crossentropy',
|
| 14 |
+
# metrics=['accuracy'])
|
| 15 |
|
| 16 |
# Define preprocessing function
|
| 17 |
def preprocess_image(image):
|