nupurkmr9 / vision-aided-gan

Ensembling Off-the-shelf Models for GAN Training (CVPR 2022 Oral)
https://www.cs.cmu.edu/~vision-aided-gan/
MIT License
382 stars 26 forks source link

TypeError: forward() got an unexpected keyword argument 'return_intermediate' #1

Closed jweihe closed 2 years ago

jweihe commented 2 years ago

i got this when run train.py. class CLIP(torch.nn.Module): ''' if 'conv_multi_level' in self.cv_type:

image_features = self.model(image.type(self.model.conv1.weight.dtype))

        image_features = self.model(image.type(self.model.conv1.weight.dtype), return_intermediate=True)//this line
nupurkmr9 commented 2 years ago

Hi, We use a modified clip model function as provided in vision_model/clip_model.py to return intermediate features. Installing the CLIP library following the steps in docs/setup.sh should prevent the above error.

git clone https://github.com/openai/CLIP.git cp vision-aided-gan/vision_model/clip_model.py CLIP/clip/model.py cd CLIP python setup.py install

Let me know if this doesn't work.