locuslab / convmixer-cifar10

Simple CIFAR-10 classification with ConvMixer
MIT License
40 stars 10 forks source link

AttributeError: module 'torchvision.transforms' has no attribute 'RandAugment' #1

Open EasonGZY opened 1 year ago

EasonGZY commented 1 year ago

Hi, I want to ask what's the version of Pytorch you used? I use the Pytorch 1.7.1 but met the following error when using RandAugment

Traceback (most recent call last): File "data_augmentation_train_shift_after.py", line 222, in transforms.RandAugment(n=1, m=8), AttributeError: module 'torchvision.transforms' has no attribute 'RandAugment'

Thanks for your sincere help!

ZhouYingJolin commented 8 months ago

same issue here, have you resolved the problem? thx

ajkdrag commented 3 months ago

Replace with shiftscalerotate from albumentations. Here's my albumentations config which i used to get similar results:

train:
  - class_name: albumentations.RandomResizedCrop
    params:
      height: 32
      width: 32
      scale: [0.75, 1.0]
      ratio: [1.0, 1.0]
      p: 1.0
  - class_name: albumentations.HorizontalFlip
    params:
      p: 0.5
  - class_name: albumentations.ShiftScaleRotate
    params:
      shift_limit: 0.0625
      scale_limit: 0.1
      rotate_limit: 10
      p: 0.5
  - class_name: albumentations.ColorJitter
    params:
      brightness: 0.1
      contrast: 0.1
      saturation: 0.1
      hue: 0
      p: 1.0
  - class_name: albumentations.CoarseDropout
    params:
      num_holes_range: [1, 2]
      hole_height_range: [4, 8]
      hole_width_range: [4, 8]
      fill_value: 0
      p: 0.25
  - class_name: albumentations.Normalize
    params:
      mean: ${datamodule.dataset.mean}
      std: ${datamodule.dataset.std}
      p: 1.0
  - class_name: albumentations.pytorch.transforms.ToTensorV2
    params:
      p: 1.0

val:
  - class_name: albumentations.Normalize
    params:
      mean: ${datamodule.dataset.mean}
      std: ${datamodule.dataset.std}
      p: 1.0
  - class_name: albumentations.pytorch.transforms.ToTensorV2
    params:
      p: 1.0