koesan commited on
Commit
b4d1c34
·
verified ·
1 Parent(s): 2ec96e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -23,15 +23,18 @@ app.config['ALLOWED_EXTENSIONS'] = {'png', 'jpg', 'jpeg', 'mha'}
23
  os.makedirs(app.config['UPLOAD_FOLDER'], mode=0o777, exist_ok=True)
24
 
25
  # Load the brain segmentation model
26
- print("Loading Brain Segmentation Model...")
27
  import warnings
28
  warnings.filterwarnings('ignore')
29
 
30
  try:
 
31
  model = load_model('brain1.h5', compile=False)
32
- print("✓ Model loaded successfully!")
33
  except Exception as e:
34
  print(f"❌ Error loading model: {e}")
 
 
35
  import traceback
36
  traceback.print_exc()
37
  raise
 
23
  os.makedirs(app.config['UPLOAD_FOLDER'], mode=0o777, exist_ok=True)
24
 
25
  # Load the brain segmentation model
26
+ print("Loading Brain Segmentation Model with TensorFlow 2.15...")
27
  import warnings
28
  warnings.filterwarnings('ignore')
29
 
30
  try:
31
+ # Load with TensorFlow 2.15 (Keras 2) - supports 'groups' parameter
32
  model = load_model('brain1.h5', compile=False)
33
+ print("✓ Model loaded successfully with TensorFlow 2.15!")
34
  except Exception as e:
35
  print(f"❌ Error loading model: {e}")
36
+ print("\n⚠️ If you see 'groups' parameter error:")
37
+ print(" Model needs TensorFlow 2.15 (not 2.16+)")
38
  import traceback
39
  traceback.print_exc()
40
  raise