Closed YichaoCode closed 1 year ago
Please use nni/examples/tutorials/darts.py
. The examples in nas/oneshot
should've been removed.
Thanks for your reply.
When I try to run the code in nni/examples/tutorials/darts.py
, I encountered another issue.
/home/root/anaconda3/envs/nas_dev/bin/python /home/root/nas_dev/nni_repo/nni/examples/tutorials/darts.py
Files already downloaded and verified
[2023-02-01 18:40:22] "/home/root/.cache/nni/nashub/darts-v2-5465b0d2.pth" already exists. Checking hash.
Accuracy: 0.9737
Files already downloaded and verified
Traceback (most recent call last):
File "/home/root/nas_dev/nni_repo/nni/examples/tutorials/darts.py", line 219, in <module>
evaluator = Classification(
File "/home/root/anaconda3/envs/nas_dev/lib/python3.10/site-packages/nni/nas/evaluator/pytorch/lightning.py", line 371, in __init__
module = ClassificationModule(criterion=criterion, learning_rate=learning_rate,
File "/home/root/anaconda3/envs/nas_dev/lib/python3.10/site-packages/nni/common/serializer.py", line 508, in __init__
super().__init__(symbol=base, args=args, kwargs=kwargs, call_super=call_super)
File "/home/root/anaconda3/envs/nas_dev/lib/python3.10/site-packages/nni/common/serializer.py", line 133, in __init__
super().__init__(
File "/home/root/anaconda3/envs/nas_dev/lib/python3.10/site-packages/nni/nas/evaluator/pytorch/lightning.py", line 308, in __init__
super().__init__(criterion, {'acc': AccuracyWithLogits},
File "/home/root/anaconda3/envs/nas_dev/lib/python3.10/site-packages/nni/nas/evaluator/pytorch/lightning.py", line 224, in __init__
self.metrics = nn.ModuleDict({name: cls() for name, cls in metrics.items()})
File "/home/root/anaconda3/envs/nas_dev/lib/python3.10/site-packages/nni/nas/evaluator/pytorch/lightning.py", line 224, in <dictcomp>
self.metrics = nn.ModuleDict({name: cls() for name, cls in metrics.items()})
TypeError: Accuracy.__new__() missing 1 required positional argument: 'task'
Process finished with exit code 1
Which step is wrong?
Your torchmetrics is too new. Try to downgrade it.
I am using torchmetric version 0.11.0 Is there a recommended version of torchmetric? And is there a recommended environment for running this code, such as a pytorch version, etc.?
0.10
Latest version is supported via #5256
hi @YatchiuLau It looks like the issue had been resolved. Could you help close this issue?
Describe the issue:
Encounter ModuleNotFoundError when run Darts Demo code from Example folders (/examples/nas/oneshot/darts/search.py)
Environment:
Configuration:
Log message:
How to reproduce it?: Run the original code without making any changes