jasonyzhang / ners

Code for "NeRS: Neural Reflectance Surfaces for Sparse-View 3D Reconstruction in the Wild," in NeurIPS 2021
https://jasonyzhang.com/ners
BSD 3-Clause "New" or "Revised" License
299 stars 32 forks source link

RuntimeError: unexpected EOF, expected 206450068 more bytes. The file might be corrupted. #4

Closed SimonCK666 closed 2 years ago

SimonCK666 commented 2 years ago

lpips.LPIPS(net=net, verbose=False)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/hyang/.conda/envs/ners/lib/python3.8/site-packages/lpips/lpips.py", line 84, in __init__
    self.net = net_type(pretrained=not self.pnet_rand, requires_grad=self.pnet_tune)
  File "/home/hyang/.conda/envs/ners/lib/python3.8/site-packages/lpips/pretrained_networks.py", line 99, in __init__
    vgg_pretrained_features = tv.vgg16(pretrained=pretrained).features
  File "/home/hyang/.conda/envs/ners/lib/python3.8/site-packages/torchvision/models/vgg.py", line 152, in vgg16
    model.load_state_dict(model_zoo.load_url(model_urls['vgg16']))
  File "/home/hyang/.conda/envs/ners/lib/python3.8/site-packages/torch/hub.py", line 559, in load_state_dict_from_url
    return torch.load(cached_file, map_location=map_location)
  File "/home/hyang/.conda/envs/ners/lib/python3.8/site-packages/torch/serialization.py", line 595, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/home/hyang/.conda/envs/ners/lib/python3.8/site-packages/torch/serialization.py", line 781, in _legacy_load
    deserialized_objects[key]._set_from_file(f, offset, f_should_read_directly)
RuntimeError: unexpected EOF, expected 206450068 more bytes. The file might be corrupted.
jasonyzhang commented 2 years ago

This looks like the pretrained VGG weights for LPIPS are corrupted. This may happen if the job is cancelled when downloading the pre-trained weights for the first time.

I would start by deleting the downloaded weights and retrying. On Linux, it defaults to ~/.cache/torch/hub. You can find the exact directory here.

jasonyzhang commented 2 years ago

Please let me know if this is still an issue. Closing due to inactivity.

SimonCK666 commented 2 years ago

Thank you very much!

This problem is solved. And After I trained Ners, it looked really good.