edtech07 commited on
Commit
b0d97f3
·
verified ·
1 Parent(s): 7b9b4a2

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. app.py +4 -1
  2. efficientnetb0_notop.h5 +3 -0
app.py CHANGED
@@ -11,9 +11,12 @@ img_size = 224
11
  # Reconstruct the base model (EfficientNetB0) architecture
12
  base_model = tf.keras.applications.EfficientNetB0(
13
  include_top=False,
14
- weights="imagenet", # Load ImageNet weights for the base model first
15
  input_shape=(img_size, img_size, 3)
16
  )
 
 
 
17
 
18
  # Freeze base_model. The fine-tuned weights will be loaded later.
19
  base_model.trainable = False
 
11
  # Reconstruct the base model (EfficientNetB0) architecture
12
  base_model = tf.keras.applications.EfficientNetB0(
13
  include_top=False,
14
+ weights=None, # IMPORTANT: Do not load imagenet weights here directly
15
  input_shape=(img_size, img_size, 3)
16
  )
17
+ # Explicitly build the base model and then load its ImageNet weights from the local file
18
+ base_model.build(input_shape=(None, img_size, img_size, 3))
19
+ base_model.load_weights('efficientnetb0_notop.h5') # Load pre-downloaded ImageNet weights
20
 
21
  # Freeze base_model. The fine-tuned weights will be loaded later.
22
  base_model.trainable = False
efficientnetb0_notop.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0683edcf6151811fb3ddd6f098ac48df644d74592c4919a5acdee1c37554add2
3
+ size 16705208