UnpicklingError: invalid load key, '<'

i tried to use pretrained InceptionResnetV1

resnet = InceptionResnetV1(
   classify=True,
   pretrained='vggface2',
   num_classes=len(dataset.class_to_idx)
).to(device)

but i get the following error :

magic_number = pickle_module.load(f, **pickle_load_args)
if magic_number != MAGIC_NUMBER:
raise RuntimeError(“Invalid magic number; corrupt file?”)
UnpicklingError: invalid load key, ‘<’.

is there something i’ve missed to add or remove? thanks for advice

Could you post a link to the model code or alternatively the model definition?
I’m not sure, what’s causing this issue, but the error might point to a pickle file, which wasn’t stored in PyTorch.

1 Like

thank you fixed the issues