MAC-AutoML / rethinking_performance_estimation_in_NAS

165 stars 22 forks source link

AttributeError: 'CIFAR10' object has no attribute 'train_data' #11

Closed JiaojiaoYe1994 closed 4 years ago

JiaojiaoYe1994 commented 4 years ago

When I try to train by random search, I met the following error. Does Data has different folder structure?

python augment.py --name=RS_BPE1 --file=random_darts_architecture.txt --data_path=data/ --save_path=experiment/ --batch_size=128 --lr=0.03 --layers=6 --init_channels=8 --epochs=10 --cutout_length=0 --image_size=16
Using multi genotypes from file
Genotype(normal=[[('dil_conv_5x5', 1), ('sep_conv_5x5', 0)], [('sep_conv_5x5', 2), ('dil_conv_5x5', 1)], [('max_pool_3x3', 2), ('sep_conv_5x5', 3)], [('max_pool_3x3', 4), ('max_pool_3x3', 0)]], normal_concat=range(2, 6), reduce=[[('dil_conv_3x3', 1), ('avg_pool_3x3', 0)], [('max_pool_3x3', 1), ('skip_connect', 2)], [('dil_conv_5x5', 1), ('avg_pool_3x3', 0)], [('dil_conv_3x3', 4), ('sep_conv_5x5', 1)]], reduce_concat=range(2, 6))

08/31 03:18:25 PM | 
08/31 03:18:25 PM | Parameters:
08/31 03:18:25 PM | AUX_WEIGHT=0.4
08/31 03:18:25 PM | BATCH_SIZE=128
08/31 03:18:25 PM | CUTOUT_LENGTH=0
08/31 03:18:25 PM | DATA_LOADER_TYPE=Torch
08/31 03:18:25 PM | DATA_PATH=data/
08/31 03:18:25 PM | DATASET=CIFAR10
08/31 03:18:25 PM | DROP_PATH_PROB=0.2
08/31 03:18:25 PM | EPOCHS=10
08/31 03:18:25 PM | FILE=random_darts_architecture.txt
08/31 03:18:25 PM | FP16=False
08/31 03:18:25 PM | GENOTYPE=Genotype(normal=[[('dil_conv_5x5', 1), ('sep_conv_5x5', 0)], [('sep_conv_5x5', 2), ('dil_conv_5x5', 1)], [('max_pool_3x3', 2), ('sep_conv_5x5', 3)], [('max_pool_3x3', 4), ('max_pool_3x3', 0)]], normal_concat=range(2, 6), reduce=[[('dil_conv_3x3', 1), ('avg_pool_3x3', 0)], [('max_pool_3x3', 1), ('skip_connect', 2)], [('dil_conv_5x5', 1), ('avg_pool_3x3', 0)], [('dil_conv_3x3', 4), ('sep_conv_5x5', 1)]], reduce_concat=range(2, 6))

08/31 03:18:25 PM | GPUS=[0]
08/31 03:18:25 PM | GRAD_CLIP=5.0
08/31 03:18:25 PM | I=0
08/31 03:18:25 PM | IMAGE_SIZE=16
08/31 03:18:25 PM | INIT_CHANNELS=8
08/31 03:18:25 PM | LAYERS=6
08/31 03:18:25 PM | LR=0.03
08/31 03:18:25 PM | MOMENTUM=0.9
08/31 03:18:25 PM | NAME=RS_BPE1
08/31 03:18:25 PM | PATH=experiment/RS_BPE1/9
08/31 03:18:25 PM | PRINT_FREQ=200
08/31 03:18:25 PM | SAVE_DIR=experiment/
08/31 03:18:25 PM | SAVE_PATH=experiment/
08/31 03:18:25 PM | SEED=2
08/31 03:18:25 PM | WEIGHT_DECAY=0.0003
08/31 03:18:25 PM | WORKERS=4
08/31 03:18:25 PM | 
08/31 03:18:25 PM | Logger is set - training start
08/31 03:18:25 PM | Torch version is: 1.6.0+cu101
08/31 03:18:25 PM | Torch_vision version is: 0.7.0+cu101
Files already downloaded and verified
Traceback (most recent call last):
  File "augment.py", line 246, in <module>
    main()
  File "augment.py", line 43, in main
    config.dataset, config.data_path, config.image_size, config.cutout_length, validation=True)
  File "/home/zjlab/yejiaojiao/test/rethinking_performance_estimation_in_NAS/utils.py", line 31, in get_data
    shape = trn_data.train_data.shape
AttributeError: 'CIFAR10' object has no attribute 'train_data'
zhengxiawu commented 4 years ago

Hi, I had answered your question two days ago, please kindly referer the issues from issue 10, here I copy the answer again: The problem is caused by different torchvision versions. There are two solutions:

1.downgrading your torchvision 2.change File "/home/zjlab/yejiaojiao/test/rethinking_performance_estimation_in_NAS/utils.py", line 31 from shape = trn_data.train_data.shape to shape = trn_data.data.shape