david-svitov / HAHA

HAHA: Highly Articulated Gaussian Human Avatars with Textured Mesh Prior
BSD 3-Clause "New" or "Revised" License
117 stars 14 forks source link

RuntimeError: unexpected EOF, expected 464151 more bytes. The file might be corrupted. #17

Closed YujiaLin-523 closed 4 months ago

YujiaLin-523 commented 4 months ago

Hi! Firstly, I want to thank you for such an amazing work! However, I met a problem when I was trying to run the evaluation code. Here is the information. Can you help me out?

Setting up [LPIPS] perceptual loss: trunk [vgg], v[0.1], spatial [off]
/home/user/miniconda/envs/textured-avatar/lib/python3.8/site-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and will be removed in 0.15, please use 'weights' instead.
  warnings.warn(
/home/user/miniconda/envs/textured-avatar/lib/python3.8/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and will be removed in 0.15. The current behavior is equivalent to passing `weights=VGG16_Weights.IMAGENET1K_V1`. You can also use `weights=VGG16_Weights.DEFAULT` to get the most up-to-date weights.
  warnings.warn(msg)
Downloading: "https://download.pytorch.org/models/vgg16-397923af.pth" to /home/user/.cache/torch/hub/checkpoints/vgg16-397923af.pth
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉| 527M/528M [01:20<00:00, 6.87MB/s]
Traceback (most recent call last):
  File "main.py", line 148, in <module>
    main(sys.argv)
  File "main.py", line 124, in main
    runner = instantiate_from_config(config.runner)
  File "/mounted/media/yanglu/4090_2/users/lyj/Project/HAHA/utils/general.py", line 34, in instantiate_from_config
    return get_obj_from_str(config["target"])(**config.get("params", dict()))
  File "/mounted/media/yanglu/4090_2/users/lyj/Project/HAHA/runners/train_gaussians.py", line 127, in __init__
    self._setup_criteria(criteria_config)
  File "/mounted/media/yanglu/4090_2/users/lyj/Project/HAHA/runners/train_gaussians.py", line 154, in _setup_criteria
    criterion = instantiate_from_config(config)
  File "/mounted/media/yanglu/4090_2/users/lyj/Project/HAHA/utils/general.py", line 34, in instantiate_from_config
    return get_obj_from_str(config["target"])(**config.get("params", dict()))
  File "/mounted/media/yanglu/4090_2/users/lyj/Project/HAHA/criteria/perceptual_loss.py", line 15, in __init__
    self._loss_fn = lpips.LPIPS(net="vgg")
  File "/home/user/miniconda/envs/textured-avatar/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/user/miniconda/envs/textured-avatar/lib/python3.8/site-packages/lpips/pretrained_networks.py", line 99, in __init__
    vgg_pretrained_features = tv.vgg16(pretrained=pretrained).features
  File "/home/user/miniconda/envs/textured-avatar/lib/python3.8/site-packages/torchvision/models/_utils.py", line 142, in wrapper
    return fn(*args, **kwargs)
  File "/home/user/miniconda/envs/textured-avatar/lib/python3.8/site-packages/torchvision/models/_utils.py", line 228, in inner_wrapper
    return builder(*args, **kwargs)
  File "/home/user/miniconda/envs/textured-avatar/lib/python3.8/site-packages/torchvision/models/vgg.py", line 410, in vgg16
    return _vgg("D", False, weights, progress, **kwargs)
  File "/home/user/miniconda/envs/textured-avatar/lib/python3.8/site-packages/torchvision/models/vgg.py", line 105, in _vgg
    model.load_state_dict(weights.get_state_dict(progress=progress))
  File "/home/user/miniconda/envs/textured-avatar/lib/python3.8/site-packages/torchvision/models/_api.py", line 63, in get_state_dict
    return load_state_dict_from_url(self.url, progress=progress)
  File "/home/user/miniconda/envs/textured-avatar/lib/python3.8/site-packages/torch/hub.py", line 731, in load_state_dict_from_url
    return torch.load(cached_file, map_location=map_location)
  File "/home/user/miniconda/envs/textured-avatar/lib/python3.8/site-packages/torch/serialization.py", line 713, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/home/user/miniconda/envs/textured-avatar/lib/python3.8/site-packages/torch/serialization.py", line 938, in _legacy_load
    typed_storage._storage._set_from_file(
RuntimeError: unexpected EOF, expected 464151 more bytes. The file might be corrupted.
YujiaLin-523 commented 4 months ago

This problem is probably related to the internet connection. I recommend you to try again to fully download these models if you have the same issue.

david-svitov commented 4 months ago

Hi! As I see you have a problem with the lpips package. Try to reinstall it or build from source: https://github.com/richzhang/PerceptualSimilarity

YujiaLin-523 commented 4 months ago

Hi! As I see you have a problem with the lpips package. Try to reinstall it or build from source: https://github.com/richzhang/PerceptualSimilarity

Thanks for your reply. I have already run your code successfully by cleaning the cache and run again to download these models.🙂