Closed AL3708 closed 2 years ago
Issue exists for all one-shot nas. I've solved it temporarily by modifying BaseOneShotLightningModule
class in base_lightning.py
. I removed unused
argument from methods:
def on_train_batch_start(self, batch, batch_idx, unused=0):
# return self.model.on_train_batch_start(batch, batch_idx, unused)
return self.model.on_train_batch_start(batch, batch_idx)
def on_train_batch_end(self, outputs, batch, batch_idx, unused=0):
# return self.model.on_train_batch_end(outputs, batch, batch_idx, unused)
return self.model.on_train_batch_end(outputs, batch, batch_idx)
This is due to an API change in PyTorch-lightning in v1.7.
Your temporary solution has already been merged into master and will be released soon. For now, try using lightning < v1.7, or do some hackings like you just did.
I have an example model from docs:
If i run experiment with Random Strategy it works fine:
but when I switch to Proxyless, then an error will occur:
Error:
Environment:
How to reproduce it?: Use code above