Open Jiawen-huang opened 3 years ago
This issue is caused by the version of pyTorch. As version updated, the source code of torchvision.datasets.CIFAR100 also has been updated. This issue can be resolved simply replace datasets.CIFAR100 by source code from [here].(https://pytorch.org/docs/0.4.0/_modules/torchvision/datasets/cifar.html#CIFAR10)
just like: img, target = self.data[index], self.targets[index] for 1.7.0
torch 1.7.0 It works.
More details in the definition of torchvision/datasets/cifar.py: class CIFAR10
I run your code:python train_student.py --path_t ./save/models/resnet32x4_vanilla/ckpt_epoch_240.pth --distill crd --model_s resnet8x4 -a 0 -b 0.8 --trial 1 but Encounter an error:
....../RepDistiller/dataset/cifar100.py", line 124, in init num_samples = len(self.train_data)
AttributeError: 'CIFAR100InstanceSample' object has no attribute 'train_data'