zju-vipa / Fast-Datafree

[AAAI-2022] Up to 100x Faster Data-free Knowledge Distillation
67 stars 11 forks source link

several problems with solutions #4

Open data-science-lover opened 2 years ago

data-science-lover commented 2 years ago

No module named 'torchvision.models.utils'

For all the people who have this error, just replace "from torchvision.models.utils import load_state_dict_from_url" by "from torch.hub import load_state_dict_from_url"

This error appears in the following files: Fast-Datafree/datafree/models/classifiers/mobilenetv2.py Fast-Datafree/datafree/models/classifiers/resnet_in.py FastDatafree/datafree/models/deeplab/backbone/mobilenetv2.py FastDatafree/datafree/models/deeplab/backbone/resnet.py

data-science-lover commented 2 years ago

"Dataset not found or corrupted"

If you get this error when you want to train from scratch cifar10 then you just have to set the download to True on lines 124 and 125 : val_dst = datasets.CIFAR10(data_root, train=False, download=True, transform=val_transform)