aoiang/few-shot-NAS

Cannot reproduce Cifar10 code

prabhant opened this issue · 1 comments

Hi I cannot reproduce cifar10 code according to the instructions:
i get this error

/few-shot-NAS/Few-Shot-NAS_cifar10$ python test.py --arch=small --gpu=1
12/07 11:31:05 PM gpu device = 1
12/07 11:31:05 PM args = Namespace(arch='small', auxiliary_weight=0.4, batch_size=96, cutout=False, cutout_length=16, data='../data', drop_path_prob=0.2, epochs=600, gpu=1, layers=20, lr=0.025, model_path='saved_models', momentum=0.9, report_freq=50, save='EXP', seed=0, wd=0.0003)
12/07 11:31:06 PM param size = 3.789982MB
Files already downloaded and verified
Traceback (most recent call last):
  File "test.py", line 134, in <module>
    main()
  File "test.py", line 97, in main
    valid_acc, valid_obj = infer(valid_queue, model, criterion)
  File "test.py", line 117, in infer
    prec1, prec5 = utils.accuracy(logits, target, topk=(1, 5))
  File "/home/few-shot-NAS/Few-Shot-NAS_cifar10/utils.py", line 43, in accuracy
    correct_k = correct[:k].view(-1).float().sum(0)
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.

Torch:1.11.5
numpy:1.19

This may be a version mismatch. Try to change view to reshape.