Rename models/yolov8_model.pt to models/yolov8n.pt
Browse files
models/{yolov8_model.pt → yolov8n.pt}
RENAMED
@@ -14,5 +14,9 @@ try:
|
|
14 |
model = YOLO("yolov8n.pt") # Automatically downloads from Ultralytics
|
15 |
model.save(MODEL_PATH)
|
16 |
print(f"Model saved to {MODEL_PATH}")
|
|
|
|
|
|
|
|
|
17 |
except Exception as e:
|
18 |
-
print(f"Failed to download or
|
|
|
14 |
model = YOLO("yolov8n.pt") # Automatically downloads from Ultralytics
|
15 |
model.save(MODEL_PATH)
|
16 |
print(f"Model saved to {MODEL_PATH}")
|
17 |
+
# Verify file integrity
|
18 |
+
import torch
|
19 |
+
checkpoint = torch.load(MODEL_PATH, map_location='cpu', weights_only=False)
|
20 |
+
print(f"Model file verified as valid PyTorch checkpoint")
|
21 |
except Exception as e:
|
22 |
+
print(f"Failed to download, save, or verify model: {str(e)}")
|