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.05k stars 1.81k forks source link

'Trainer' object has no attribute 'optimizer_frequencies' #5456

Open yasmineLalabouali opened 1 year ago

yasmineLalabouali commented 1 year ago

Describe the issue: when running the experiment via experiment.run(config), this error throws : AttributeError Traceback (most recent call last) in 6 config = RetiariiExeConfig(execution_engine='oneshot') 7 experiment = RetiariiExperiment(model_space, evaluator=evaluator, strategy=strategy) ----> 8 experiment.run(config)

16 frames /usr/local/lib/python3.9/dist-packages/nni/nas/oneshot/pytorch/base_lightning.py in advance_optimization(self, loss, batch_idx, gradient_clip_val, gradient_clip_algorithm) 442 raise ValueError('This method should not be used when automatic optimization is turned on.') 443 --> 444 if self.trainer.optimizer_frequencies: 445 warnings.warn('optimizer_frequencies is not supported in NAS. It will be ignored.', UserWarning) 446

AttributeError: 'Trainer' object has no attribute 'optimizer_frequencies'

Environment:

Configuration:

matluster commented 1 year ago

It still takes some time for us to finally support pytorch-lightning 2.0. For now, please stick to pytorch-lightning 1.9.4.

Lijiaoa commented 1 year ago

Related PR #5466