Skip to content

Error executing job with overrides: ['model=yolov8l.pt', 'source=test3.mp4', 'show=True'] #71

@hellozhanghuan

Description

@hellozhanghuan

Error executing job with overrides: ['model=yolov8l.pt', 'source=test3.mp4', 'show=True']
Traceback (most recent call last):
File "D:\Project\pythonProject\YOLOv8-DeepSORT-Object-Tracking\ultralytics\yolo\v8\detect[predict.py](javascript:void(0);)", line 253, in predict
predictor()
~~~~~~~~~^^
File "D:\Project\pythonProject.venv\Lib\site-packages\torch\utils_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
File "D:\Project\pythonProject\YOLOv8-DeepSORT-Object-Tracking\ultralytics\yolo\engine[predictor.py](javascript:void(0);)", line 164, in call
model = self.model if self.done_setup else self.setup(source, model)
~~~~~~~~~~^^^^^^^^^^^^^^^
File "D:\Project\pythonProject\YOLOv8-DeepSORT-Object-Tracking\ultralytics\yolo\engine[predictor.py](javascript:void(0);)", line 121, in setup
model = AutoBackend(model, device=device, dnn=self.args.dnn, fp16=self.args.half)
File "D:\Project\pythonProject\YOLOv8-DeepSORT-Object-Tracking\ultralytics\nn[autobackend.py](javascript:void(0);)", line 73, in init
model = attempt_load_weights(weights if isinstance(weights, list) else w,
device=device,
inplace=True,
fuse=fuse)
File "D:\Project\pythonProject\YOLOv8-DeepSORT-Object-Tracking\ultralytics\nn[tasks.py](javascript:void(0);)", line 303, in attempt_load_weights
ckpt = torch.load(attempt_download(w), map_location='cpu') # load
File "D:\Project\pythonProject.venv\Lib\site-packages\torch[serialization.py](javascript:void(0);)", line 1470, in load
raise pickle.UnpicklingError(_get_wo_message(str(e))) from None
_pickle.UnpicklingError: Weights only load failed. This file can still be loaded, to do so you have two options, do those steps only if you trust the source of the checkpoint.
(1) In PyTorch 2.6, we changed the default value of the weights_only argument in torch.load from False to True. Re-running torch.lo ad with weights_only set to False will likely succeed, but it can result in arbitrary code execution. Do it only if you got the file from a trusted source.
(2) Alternatively, to load with weights_only=True please check the recommended steps in the following error message.
WeightsUnpickler error: Unsupported global: GLOBAL ultralytics.nn.tasks.DetectionModel was not an allowed global by default. Please use tor ch.serialization.add_safe_globals([DetectionModel]) or the torch.serialization.safe_globals([DetectionModel]) context manager to allowlist this global if you trust this class/function.

Check the documentation of torch.load to learn more about types accepted by default with weights_only https://pytorch.org/docs/stable/generated/torch.load.html.

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

sir please tell me how to solve the above errors,thank you so much!!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions