cifar10-fast icon indicating copy to clipboard operation
cifar10-fast copied to clipboard

BUG: data and target CIFAR10 fields for torchvision 0.2.2

Open scottclowe opened this issue 5 years ago • 1 comments

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 and test_data to data
  • both train_labels and test_labels to targets

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).

scottclowe avatar Mar 25 '19 21:03 scottclowe

Ran into this and debugged it myself, but your PR seems like an elegant solution so thank you.

sdoria avatar Sep 05 '19 01:09 sdoria