yanx27 / EverybodyDanceNow_reproduce_pytorch

Everybody dance now reproduced in pytorch
MIT License
605 stars 174 forks source link

module 'torchvision.models.vgg' has no attribute 'cfg' #86

Closed maveeshah closed 4 years ago

maveeshah commented 4 years ago

self.vgg_features = vgg.make_layers(vgg.cfg['D']) AttributeError: module 'torchvision.models.vgg' has no attribute 'cfg'

File "./face_enhancer/main.py", line 68, in main(is_debug) File "./face_enhancer/main.py", line 59, in main trainer = Trainer(ckpt_dir, log_dir, face_dataset, data_loader, log_every=1, save_every=1) File "face_enhancer/trainer.py", line 35, in init self.recon_loss = VGG_perceptual_loss(pretrained=True, device=self.device) File "/face_enhancer/utils/perceptual_loss.py", line 14, in init self.vgg_features = vgg.make_layers(vgg.cfg['D']) AttributeError: module 'torchvision.models.vgg' has no attribute 'cfg'

maveeshah commented 4 years ago

it was solved by downgrading torchvision

pip install torchvision==0.2.2.post3

WangYaC commented 1 year ago

self.vgg_features = vgg.make_layers([64, 64, 'M', 128, 128, 'M', 256, 256, 256, 'M', 512, 512, 512, 'M', 512, 512, 512, 'M']) https://pytorch.org/vision/stable/_modules/torchvision/models/vgg.html works