wwieerrz Claude commited on
Commit
2a84f48
·
1 Parent(s): f79c34e

Add detailed error logging to debug model loading

Browse files

- Print full traceback when model loading fails
- Show error type and message
- This will help us see EXACTLY why it's falling back to DEMO MODE

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -32,17 +32,21 @@ from backend.utils.image_processing import (
32
  @st.cache_resource
33
  def load_model():
34
  try:
 
35
  from backend.utils.transformers_depth import TransformersDepthEstimator
36
- print("[*] Loading REAL AI Depth-Anything V2 BASE model...")
37
  print("[*] This will download ~372MB on first run (one-time download)")
38
  depth_estimator = TransformersDepthEstimator(model_size="base")
39
  print("[+] REAL AI MODE ACTIVE - BASE MODEL!")
40
  print("[+] Quality: SUPERB (best available)")
41
  return depth_estimator, True, "BASE (372MB)"
42
  except Exception as e:
43
- print(f"[!] Could not load AI models: {e}")
 
 
 
 
44
  print("[*] Falling back to DEMO MODE")
45
- from backend.utils.demo_depth import generate_smart_depth
46
  return None, False, "Demo Mode"
47
 
48
  depth_estimator, USE_REAL_AI, MODEL_SIZE = load_model()
 
32
  @st.cache_resource
33
  def load_model():
34
  try:
35
+ print("[*] Attempting to import TransformersDepthEstimator...")
36
  from backend.utils.transformers_depth import TransformersDepthEstimator
37
+ print("[*] Import successful! Loading REAL AI Depth-Anything V2 BASE model...")
38
  print("[*] This will download ~372MB on first run (one-time download)")
39
  depth_estimator = TransformersDepthEstimator(model_size="base")
40
  print("[+] REAL AI MODE ACTIVE - BASE MODEL!")
41
  print("[+] Quality: SUPERB (best available)")
42
  return depth_estimator, True, "BASE (372MB)"
43
  except Exception as e:
44
+ print(f"[!] FULL ERROR TRACEBACK:")
45
+ import traceback
46
+ traceback.print_exc()
47
+ print(f"[!] Error type: {type(e).__name__}")
48
+ print(f"[!] Error message: {str(e)}")
49
  print("[*] Falling back to DEMO MODE")
 
50
  return None, False, "Demo Mode"
51
 
52
  depth_estimator, USE_REAL_AI, MODEL_SIZE = load_model()