You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(simple): report missing weights file cleanly instead of traceback in verify #294
In simple/ovl.py, passing a nonexistent file path to --weights in verify causes load_weights to crash with an unhandled FileNotFoundError traceback:
Traceback (most recent call last):
File "simple/ovl.py", line 620, in cmd_verify
sd = load_weights(a.weights)
File "simple/ovl.py", line 544, in load_weights
return torch.load(path, map_location="cpu", weights_only=True)
FileNotFoundError: [Errno 2] No such file or directory: 'nonexistent.pt'
Proposed Fix
In load_weights(path) in simple/ovl.py, check whether the specified file exists before attempting to load it:
ifnotPath(path).exists():
sys.exit(f"weights {path} not found")
This would allow missing weights files to exit cleanly with an informative error message, matching how the rest of cmd_verify handles missing input files.
AI Usage Disclosure
Identified with Gemini 3.8 Flash via Google Antigravity IDE.
Reproduced locally and confirmed the FileNotFoundError behavior.
Closing: I noticed maintainer @ryoari already implemented this in open PR #281 (if a.weights and not Path(a.weights).is_file(): sys.exit(...)). Looking forward to #281 merging!
Activity
agarwalpranav0711 commentedon Nov 2, 2026
I'd like to work on this!
agarwalpranav0711 commentedon Nov 2, 2026
Closing: I noticed maintainer @ryoari already implemented this in open PR #281 (
if a.weights and not Path(a.weights).is_file(): sys.exit(...)). Looking forward to #281 merging!