Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'CIFAR100Instance' object has no attribute 'train_data' #4

Closed
LiqunChen0606 opened this issue Nov 6, 2019 · 2 comments

Comments

@LiqunChen0606
Copy link

Thanks for your impressive work!

I try to reproduce the results from your paper, but when I test the code (i.e. cmd python train_student.py --path_t ./save/models/resnet32x4_vanilla/ckpt_epoch_240.pth --distill kd --model_s resnet8x4 -r 0.1 -a 0.9 -b 0 --trial 1), it shows:

File "~/work/RepDistiller/dataset/cifar100.py", line 44, in getitem
img, target = self.train_data[index], self.train_labels[index]
AttributeError: 'CIFAR100Instance' object has no attribute 'train_data'

By the way, my environment: Ubuntu 18.01, Python 3.6, Pytorch 1.2, torchvision 0.4.1,
I also tested on Pytorch 0.4.0, still same issue

Could you please help me with this?

Thanks

@HobbitLong
Copy link
Owner

HobbitLong commented Nov 6, 2019

Hi @LiqunChen0606 ,

It sounds like your datasets.CIFAR100 object does not have the train_data attribute, which might relate to torchvision.

How about switching torchvision version back to version of 0.2.1?

===
update:
for torchvision 0.4.1, you might want to use self.data and self.targets instead. See here

@LiqunChen0606
Copy link
Author

Thanks very much! Problem solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants