nerdyrodent / VQGAN-CLIP

Just playing with getting VQGAN+CLIP running locally, rather than having to use colab.
Other
2.61k stars 427 forks source link

RuntimeError: requires_grad_ is not supported on ScriptModules #16

Closed johndpope closed 3 years ago

johndpope commented 3 years ago

I don't know what happened - but had a working setup - and then was tinkering with facebook faiss - and gcc and now hit this problem.


python generate.py -p "The fashion of tomorrow"
/home/jp/Documents/gitWorkspace/VQGAN-CLIP/CLIP/clip/clip.py:23: UserWarning: PyTorch version 1.7.1 or higher is recommended
  warnings.warn("PyTorch version 1.7.1 or higher is recommended")
Working with z of shape (1, 256, 16, 16) = 65536 dimensions.
loaded pretrained LPIPS loss from taming/modules/autoencoder/lpips/vgg.pth
VQLPIPSWithDiscriminator running with hinge loss.
Restored from checkpoints/vqgan_imagenet_f16_16384.ckpt
Traceback (most recent call last):
  File "generate.py", line 361, in <module>
    perceptor = clip.load(args.clip_model, jit=jit)[0].eval().requires_grad_(False).to(device)
  File "/home/jp/miniconda3/lib/python3.8/site-packages/torch/jit/_script.py", line 919, in fail
    raise RuntimeError(name + " is not supported on ScriptModules")
RuntimeError: requires_grad_ is not supported on ScriptModules

I'm on 1.10 nightly build of pytorch.


>>> print(torch.__version__)
1.10.0.dev20210715+cu111
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
>>> exit()
johndpope commented 3 years ago

this repo is not working on nightlybuilds of pytorch 1.10.x I rolled back to 1.8 and all good. torch.version: 1.8.0.dev20210208+cu110