How to fix ‘_pickle.UnpicklingError: invalid load key, ‘<‘ ‘ error in Pytorch

The problem I encountered when I ran the official code of maskrcnn-benchmark for facebookresearch,which was wrong when loading the pre-training model.

The code runs on a remote server at the school and the graphics card is an NVIDIA P100.

checkpointer = DetectronCheckpointer( cfg, model, optimizer, scheduler, output_dir, save_to_disk) extra_checkpoint_data = checkpointer.load(cfg.MODEL.WEIGHT) arguments.update(extra_checkpoint_data)

I expect to run the code correctly and understand why this is the problem.

原因:The reason about the problem is that the previous download was not finished. So when I deleted the original file and re-downloaded it, the problem was solved.
参数没有办法反序列化,长度小于标准,可能的原因是参数没有下载完整,需要重新下载参数。

参考:https://stackoverflow.com/questions/56391392/how-to-fix-pickle-unpicklingerror-invalid-load-key-error-in-pytorch

你可能感兴趣的:(pytorch,深度学习,python)