Skip to content

Conversation

@NebulaMao
Copy link

@NebulaMao NebulaMao commented Sep 8, 2025

issue: #71

This pull request improves the robustness of the YOLO model loading process in modules/subcore.py by adding compatibility for different PyTorch versions. The main change is the introduction of a fallback mechanism to ensure that the model loads correctly, regardless of whether the newer safe_globals feature is available.

Model loading compatibility improvements:

  • Updated the load_yolo function to first attempt loading the model using PyTorch 2.6+'s safe_globals context, and if that fails (due to missing features or incompatible types), it falls back to the previous loading method. If both attempts fail, the error is logged and re-raised for better debugging.

@NebulaMao NebulaMao force-pushed the fix/unpickling-error-pytorch-2.6 branch from 9e206ec to 969c14e Compare September 8, 2025 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant