我可以使用例如squeezenet进行培训,但是我对此并不陌生,所以我无法弄清楚需要成功实例化其他哪些架构(例如darknet,xception或xresnet)。
我在笔记本上尝试过:
arch = models.Darknet(num_classes = 2, num_blocks = 4) // whats numblocks
learn2 = cnn_learner(data = data, base_arch = arch , metrics=[accuracy, error_rate], pretrained = True)
我收到错误消息:
----> 1 arch = models.Darknet(num_classes = 2,num_blocks = 4)
2 learn2 = cnn_learner(data = data, base_arch = arch , metrics=[accuracy, error_rate], pretrained = True)
/usr/local/lib/python3.6/dist-packages/fastai/vision/models/darknet.py in __init__(self, num_blocks, num_classes, nf)
31 super().__init__()
32 layers = [conv_bn_lrelu(3, nf, ks=3, stride=1)]
---> 33 for i,nb in enumerate(num_blocks):
34 layers += self.make_group_layer(nf, nb, stride=2-(i==1))
35 nf *= 2
TypeError: 'int' object is not iterable```