microsoft / nni

An open source AutoML toolkit for automate machine learning lifecycle, including feature engineering, neural architecture search, model compression and hyper-parameter tuning.
https://nni.readthedocs.io
MIT License
14.07k stars 1.82k forks source link

AssertionError on RetiariiExperiment #4235

Closed ding3820 closed 3 years ago

ding3820 commented 3 years ago

Hi, I was trying to run one-shot NAS (Darts) on my model and dataset following the instruction on this. Everything went correctly until I tried the following code:

from nni.retiarii.experiment.pytorch import RetiariiExperiment

exp = RetiariiExperiment(model, trainer)
exp.run()

This code is from https://github.com/microsoft/nni/blob/9a4d0d67506f5e1197238344fed858305fbb4494/test/retiarii_test/darts/test_oneshot.py#L102 Here's the error message I received: image

Looks like this part of the error handling is not complete. I have no idea where to fix this issue so I post here. Thx

Environment:

ultmaster commented 3 years ago

Please restart the kernel and try again. Have you run this code twice? It seems that register_advisor have already been executed before.

ding3820 commented 3 years ago

Thanks it works.