cake-lab / Few-shot-NAS

The official repo for Few-Shot Neural Architecture Search (ICML'21 long oral)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RuntimeError: view size is not compatible with input tensor's size and stride

adaaaaaa opened this issue · comments

python test.py --arch small
08/17 02:53:34 PM gpu device = 0
08/17 02:53:34 PM args = Namespace(data='../data', batch_size=96, lr=0.025, momentum=0.9, wd=0.0003, report_freq=50, gpu=0, epochs=600, layers=20, model_path='saved_models', auxiliary_weight=0.4, cutout=False, cutout_length=16, drop_path_prob=0.2, seed=0, arch='small', save='EXP')
08/17 02:53:37 PM param size = 3.789982MB
Files already downloaded and verified
/home/captain/.local/lib/python3.9/site-packages/torch/nn/functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at /pytorch/c10/core/TensorImpl.h:1156.)
return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode)
tensor(95., device='cuda:0')
Traceback (most recent call last):
File "/home/captain/competition/study/Few-shot-NAS/Few-Shot-NAS_cifar10/test.py", line 134, in
main()
File "/home/captain/competition/study/Few-shot-NAS/Few-Shot-NAS_cifar10/test.py", line 97, in main
valid_acc, valid_obj = infer(valid_queue, model, criterion)
File "/home/captain/competition/study/Few-shot-NAS/Few-Shot-NAS_cifar10/test.py", line 117, in infer
prec1, prec5 = utils.accuracy(logits, target, topk=(1, 5))
File "/home/captain/competition/study/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.