cifar10-fast
cifar10-fast copied to clipboard
BUG: data and target CIFAR10 fields for torchvision 0.2.2
In the latest release of torchvision, v0.2.2 [release notes], the fields of the CIFAR10 object containing the data were changed from
- both
train_data
andtest_data
todata
- both
train_labels
andtest_labels
totargets
These changes were made in PR https://github.com/pytorch/vision/pull/594
Our code is pulling the data out from the old fields, which are not supported in current and future versions of torchvision.
To ensure we can support both torchvision <=0.2.1 and >=0.2.2, the fix checks for and uses whichever of these two versions exists (with a preference for the new naming convention if it is available).
Ran into this and debugged it myself, but your PR seems like an elegant solution so thank you.