Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lots of errors #43

Closed
ngmisl opened this issue May 4, 2022 · 6 comments
Closed

lots of errors #43

ngmisl opened this issue May 4, 2022 · 6 comments

Comments

@ngmisl
Copy link

ngmisl commented May 4, 2022

❯ python main.py --im_path1 90.png --im_path2 15.png --im_path3 117.png --sign realistic --smooth 5
Loading StyleGAN2 from checkpoint: pretrained_models/ffhq.pt
Setting up Perceptual loss...
Traceback (most recent call last):
  File "main.py", line 117, in <module>
    main(args)
  File "main.py", line 18, in main
    ii2s = Embedding(args)
  File "/home/fg/dev/python/Barbershop/models/Embedding.py", line 25, in __init__
    self.setup_embedding_loss_builder()
  File "/home/fg/dev/python/Barbershop/models/Embedding.py", line 94, in setup_embedding_loss_builder
    self.loss_builder = EmbeddingLossBuilder(self.opts)
  File "/home/fg/dev/python/Barbershop/losses/embedding_loss.py", line 18, in __init__
    self.percept = lpips.PerceptualLoss(model="net-lin", net="vgg", use_gpu=use_gpu)
  File "/home/fg/dev/python/Barbershop/losses/lpips/__init__.py", line 22, in __init__
    self.model.initialize(model=model, net=net, use_gpu=use_gpu, colorspace=colorspace, spatial=self.spatial, gpu_ids=gpu_ids)
  File "/home/fg/dev/python/Barbershop/losses/lpips/dist_model.py", line 63, in initialize
    use_dropout=True, spatial=spatial, version=version, lpips=True)
  File "/home/fg/dev/python/Barbershop/losses/lpips/networks_basic.py", line 50, in __init__
    self.net = net_type(pretrained=not self.pnet_rand, requires_grad=self.pnet_tune)
  File "/home/fg/dev/python/Barbershop/losses/lpips/pretrained_networks.py", line 100, in __init__
    vgg_pretrained_features = tv.vgg16(pretrained=pretrained).features
  File "/home/fg/anaconda3/envs/plswork/lib/python3.7/site-packages/torchvision/models/vgg.py", line 150, in vgg16
    return _vgg('vgg16', 'D', False, pretrained, progress, **kwargs)
  File "/home/fg/anaconda3/envs/plswork/lib/python3.7/site-packages/torchvision/models/vgg.py", line 93, in _vgg
    progress=progress)
  File "/home/fg/anaconda3/envs/plswork/lib/python3.7/site-packages/torch/hub.py", line 559, in load_state_dict_from_url
    return torch.load(cached_file, map_location=map_location)
  File "/home/fg/anaconda3/envs/plswork/lib/python3.7/site-packages/torch/serialization.py", line 595, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/home/fg/anaconda3/envs/plswork/lib/python3.7/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 477241 more bytes. The file might be corrupted.

@Styml
Copy link

Styml commented May 5, 2022

seems like you didn't download model properly and it was corrupted. Maybe try again?

@ngmisl
Copy link
Author

ngmisl commented May 6, 2022

seems like you didn't download model properly and it was corrupted. Maybe try again?

tried already. cloned the repo and made a clean conda env, results are the same, unfortunately.

@philippjess
Copy link

The model download happens when you run main.py, Your answer doesnt get to that step, for me gdrive is blocking the download so i had to do it manually.

@ngmisl
Copy link
Author

ngmisl commented May 9, 2022

Manually downloaded it too, as far as I'm concerned my setup is complete. 🙁

@philippjess
Copy link

philippjess commented May 9, 2022

sha256: 48a146c502117a283437d1c14f755a9416eb9255694e0964403f95b14fc094e9 ffhq.pt

@philippjess
Copy link

philipp@mars:~/git/ai/Barbershop/losses/lpips/weights/v0.1> sha256sum vgg.pth
a78928a0af1e5f0fcb1f3b9e8f8c3a2a5a3de244d830ad5c1feddc79b8432868  vgg.pth

This also gets downloaded in main.py

@ngmisl ngmisl closed this as completed Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants