我正在使用Lasagne + Theano創建一個ResNet,並且正在努力使用DenseLayer。如果我使用http://lasagne.readthedocs.io/en/latest/modules/layers/dense.html上的示例,它可以工作。lasagne.layers.DenseLayer:「__init __()至少需要3個參數」
l_in = InputLayer((100, 20))
l1 = DenseLayer(l_in, num_units=50)
但是,如果我想使用它在我的項目:
#other layers
resnet['res5c_branch2c'] = ConvLayer(resnet['res5c_branch2b'], num_filters=2048, filter_size=1, pad=0, flip_filters=False)
resnet['pool5'] = PoolLayer(resnet['res5c'], pool_size=7, stride=1, mode='average_exc_pad', ignore_border=False)
resnet['fc1000'] = DenseLayer(resnet['pool5'], num_filter=1000)
Traceback (most recent call last):File "convert_resnet_101_caffe.py", line 167, in <module>
resnet['fc1000'] = DenseLayer(resnet['pool5'], num_filter=1000)TypeError: __init__() takes at least 3 arguments (2 given)
謝謝,我沒有看到:)這是一個錯字 – TobSta