PPO Tuner Unavailable for Classical NAS #3832
-
Environment:
Log message:
What issue meet, what's expected?: PPO Tuner failed to load when creating new classcial NAS experiments, which also occurs on version 1.9. How to reproduce it?: Manually prepare a CNN model and code for auto-generation, run Additional information: my authorName: default
experimentName: example_with_cifar_classical_NAS
trialConcurrency: 1
maxExecDuration: 100h
maxTrialNum: 10
#choice: local, remote, pai
trainingServicePlatform: local
#please use `nnictl ss_gen` to generate search space file first
# searchSpacePath: <the_generated_search_space_path>
searchSpacePath: nni_auto_gen_search_space.json
useAnnotation: false
tuner:
builtinTunerName: PPOTuner
classArgs:
optimize_mode: maximize
trial:
command: python classical.py
codeDir: .
gpuNum: 0 my {
"conv1": {
"_type": "layer_choice",
"_value": [
"conv3*3",
"conv5*5"
]
},
"mid_conv": {
"_type": "layer_choice",
"_value": [
"0",
"1"
]
},
"skip_conv": {
"_type": "input_choice",
"_value": {
"candidates": [
"",
""
],
"n_chosen": 1
}
}
} my model for NAS: class NeuralNet(nn.Module):
def __init__(self):
super(NeuralNet, self).__init__()
self.conv1 = mutables.LayerChoice(OrderedDict([
("conv3*3", nn.Conv2d(3, 8, 3, 1)),
("conv5*5", nn.Conv2d(3, 8, 5, 1))
]), key='conv1')
self.mid_conv = mutables.LayerChoice([
nn.Conv2d(8, 8, 3, 1, padding=1),
nn.Conv2d(8, 8, 5, 1, padding=2)
], key='mid_conv')
self.conv2 = nn.Conv2d(8, 16, 5, 1)
self.pool = nn.MaxPool2d(2, 2)
self.func1 = nn.Linear(16 * 5 * 5, 120)
self.func2 = nn.Linear(120, 84)
self.func3 = nn.Linear(84, 10)
self.input_switch = mutables.InputChoice(n_candidates=2, n_chosen=1, key="skip_conv")
def forward(self, x):
x = self.pool(F.relu(self.conv1(x)))
old_x = x
zero_x = torch.zeros_like(old_x)
skip_x = self.input_switch([zero_x, old_x])
x = F.relu(self.mid_conv(x))
x += skip_x
x = self.pool(F.relu(self.conv2(x)))
x = x.view(-1, 16 * 5 * 5)
x = F.relu(self.func1(x))
x = F.relu(self.func2(x))
x = self.func3(x)
return x |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
@Garen-Wang thanks for reporting this issue. PPOTuner requires additional packages, so need to install with |
Beta Was this translation helpful? Give feedback.
-
@QuanluZhang Thanks a lot for your help. Having installed |
Beta Was this translation helpful? Give feedback.
-
@QuanluZhang, it seems that classic NAS has been refactored in Retiarii, so should we update the doc of tuners used by NAS in the HPO part? |
Beta Was this translation helpful? Give feedback.
-
@kvartet we can remove PPOTuner from HPO tuners, as PPO has been supported in Retiarii framework (i.e., |
Beta Was this translation helpful? Give feedback.
-
The classical NAS using PPO Tuner has been migrated to
|
Beta Was this translation helpful? Give feedback.
The classical NAS using PPO Tuner has been migrated to
PolicyBasedRL
in Retiarii Framework, if you met this error, please upgrade NNI version and usenni.retiarii.strategy.PolicyBasedRL
(the first choice) or install additional packages(the second choice) according to the above: