Patch torch.load(..., weights_only=False) to reduce warnings (#14638)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
72466b9648
commit
fb20867262
3 changed files with 34 additions and 3 deletions
|
|
@ -1066,8 +1066,9 @@ TESTS_RUNNING = is_pytest_running() or is_github_action_running()
|
|||
set_sentry()
|
||||
|
||||
# Apply monkey patches
|
||||
from ultralytics.utils.patches import imread, imshow, imwrite, torch_save
|
||||
from ultralytics.utils.patches import imread, imshow, imwrite, torch_load, torch_save
|
||||
|
||||
torch.load = torch_load
|
||||
torch.save = torch_save
|
||||
if WINDOWS:
|
||||
# Apply cv2 patches for non-ASCII and non-UTF characters in image paths
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue