Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Add a bugfix for conv1d in the cdarts utils. In utils.py, change accu… #3073

Merged
merged 1 commit into from
Nov 13, 2020

Conversation

athaker
Copy link
Contributor

@athaker athaker commented Nov 9, 2020

For 1d cdarts convolutions we cannot use .view(), instead we need to use reshape.

@QuanluZhang
Copy link
Contributor

@athaker thanks for your pr. Could you post the error message you encountered without this fix?

@athaker
Copy link
Contributor Author

athaker commented Nov 13, 2020

@athaker thanks for your pr. Could you post the error message you encountered without this fix?

Please find code below:

File "search.py", line 92, in <module> trainer.train() File "/home/aht47801/.conda/envs/try-nni/lib/python3.7/site-packages/nni/nas/pytorch/cdarts/trainer.py", line 265, in train self._warmup(PHASE_SMALL, epoch) File "/home/aht47801/.conda/envs/try-nni/lib/python3.7/site-packages/nni/nas/pytorch/cdarts/trainer.py", line 184, in _warmup prec1, prec5 = accuracy(logits_main, y, topk=(1, 5)) File "/home/aht47801/.conda/envs/try-nni/lib/python3.7/site-packages/nni/nas/pytorch/cdarts/utils.py", line 62, 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.

@liuzhe-lz liuzhe-lz merged commit fcbf05b into microsoft:master Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants