NVIDIA / DeepLearningExamples

State-of-the-Art Deep Learning scripts organized by models - easy to train and deploy with reproducible accuracy and performance on enterprise-grade infrastructure.
13.63k stars 3.24k forks source link

[SSD/Pytorch] RuntimeError: unexpected EOF, expected 74898 more bytes. The file might be corrupted. #1088

Open WangXin93 opened 2 years ago

WangXin93 commented 2 years ago

Related to [SSD/Pytorch]

Describe the bug I met RuntimeError: expected 74898 more bytes. The file might be corrupted. when I load the ssd pytorch model. It seems the model file is corrupted but I do not know where to download the right file.

Steps to reproduce the behavior:

import torch
m = torch.hub.load('NVIDIA/DeepLearningExamples:torchhub', 'nvidia_ssd', model_math='fp32')

I also download the model manually from https://catalog.ngc.nvidia.com/orgs/nvidia/models/ssd_pyt_ckpt_amp, then use torch.load(ckpt_file) to load the model, but get the same error.

I want to know how to load SSD pytorch model correctly.

Environment

NeverGiveU commented 2 years ago

hi, i just met the same issue. and i reload the ckpt by wget https://api.ngc.nvidia.com/v2/models/nvidia/ssd_pyt_ckpt_amp/versions/20.06.0/files/nvidia_ssdpyt_amp_200703.pt. and modify the source codes:

  1. add force_reload=False when initializing the model, and
  2. update the checkpoint value to the local ckpt. image