Skip to content

Exception has occurred: UnpicklingError Weights only load failed. #16

@shaojun

Description

@shaojun

exceptioned in code line:

import numpy as np
from ultralytics import YOLO
import cv2

import util
from util import get_car, read_license_plate, write_csv
license_plate_detector = YOLO('/home/shao/Automatic-License-Plate-Recognition-using-YOLOv8/license_plate_detector.pt')

exception detail:

Exception has occurred: UnpicklingError
Weights only load failed. This file can still be loaded, to do so you have two options, �[1mdo those steps only if you trust the source of the checkpoint�[0m. 
	(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.load` with `weights_only` set to `False` will likely succeed,

i have installed the requirements.txt and checked the version as below:

pip list | grep ultra
ultralytics              8.0.114

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