Open yyh7773 opened 1 year ago
MyModelSpace( (conv1): Conv2d(1, 32, kernel_size=(3, 3), stride=(1, 1)) (conv2): LayerChoice( label='conv2' (0): Conv2d(32, 64, kernel_size=(3, 3), stride=(1, 1)) (1): DepthwiseSeparableConv( (depthwise): Conv2d(32, 32, kernel_size=(3, 3), stride=(1, 1), groups=32) (pointwise): Conv2d(32, 64, kernel_size=(1, 1), stride=(1, 1)) ) ) (dropout1): MutableDropout(p=Categorical([0.25, 0.5, 0.75], label='dropout')) (dropout2): Dropout(p=0.5, inplace=False) (fc1): MutableLinear(in_features=9216, out_features=Categorical([64, 128, 256], label='feature')) (fc2): MutableLinear(in_features=Categorical([64, 128, 256], label='feature'), out_features=10) ) 我的搜索空间与Demo中一样
I got same problem, have you solved it ?
''Hello,NAS'':GPU can't be used but i set all: and if i use CPU,there is a error :策略执行失败
Environment:
Configuration:
Search space:class MyModelSpace(ModelSpace): def init(self): super().init() self.conv1 = nn.Conv2d(1, 32, 3, 1)
LayerChoice is used to select a layer between Conv2d and DwConv.
def forward(self, x): x = F.relu(self.conv1(x)) x = F.max_pool2d(self.conv2(x), 2) x = torch.flatten(self.dropout1(x), 1) x = self.fc2(self.dropout2(F.relu(self.fc1(x)))) output = F.log_softmax(x, dim=1) return output
model_space = MyModelSpace()
上述是我的设置情况,请问应该如何解决?