annie08 commited on
Commit
30ab3e7
·
1 Parent(s): 4876f0e

changed layer

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -7,9 +7,10 @@ from tensorflow.keras.models import Model
7
  from tensorflow.keras.applications.mobilenet_v2 import MobileNetV2, preprocess_input
8
  from tensorflow.keras.preprocessing.sequence import pad_sequences
9
 
10
- # Load MobileNetV2 model for feature extraction
11
  mobilenet_model = MobileNetV2(weights="imagenet")
12
- mobilenet_model = Model(inputs=mobilenet_model.inputs, outputs=mobilenet_model.layers[-2].output)
 
13
 
14
  # Load the trained captioning model
15
  model = tf.keras.models.load_model("model_9.h5")
 
7
  from tensorflow.keras.applications.mobilenet_v2 import MobileNetV2, preprocess_input
8
  from tensorflow.keras.preprocessing.sequence import pad_sequences
9
 
10
+ # Load MobileNetV2 model for feature extraction (using the final layer)
11
  mobilenet_model = MobileNetV2(weights="imagenet")
12
+ mobilenet_model = Model(inputs=mobilenet_model.inputs, outputs=mobilenet_model.layers[-1].output)
13
+
14
 
15
  # Load the trained captioning model
16
  model = tf.keras.models.load_model("model_9.h5")