from lasagne import layers
layers=[('input', layers.InputLayer),('conv1', layers.Conv2DLayer),('pool1', layers.MaxPool2DLayer),
('conv2', layers.Conv2DLayer),
('pool2', layers.MaxPool2DLayer),
('conv3', layers.Conv2DLayer),
('pool3', layers.MaxPool2DLayer),
('hidden4', layers.DenseLayer),
('hidden5', layers.DenseLayer),
('output', layers.DenseLayer),
]**strong text**
from nolearn.lasagne import NeuralNet
nnet = NeuralNet(layers=layers,input_shape=(None, 3, 32, 32),conv1_num_filters=32,
conv1_filter_size=(3, 3),
conv2_num_filters=64,
conv2_filter_size=(2, 2),
conv3_num_filters=128,
conv3_filter_size=(2, 2),
pool1_ds=(2,2),
pool2_ds=(2,2),
pool3_ds=(2,2),
hidden4_num_units=500,
hidden5_num_units=500,
output_num_units=10,
output_nonlinearity=softmax,
update_learning_rate=0.01,
update_momentum=0.9,
regression=True,
max_epochs=3,
verbose=1)
nnet.fit(X_train, y_train)
nnet.fit(X_train,y_train)>文件“ /home/pandu/anaconda3/lib/python3.7/site-packages/nolearn-0.6.1.dev0->py3.7.egg/nolearn/lasagne/ base.py”,第697行,适合> self.initialize()>文件“ /home/pandu/anaconda3/lib/python3.7/site-packages/nolearn-0.6.1.dev0->py3.7.egg /nolearn/lasagne/base.py“,第485行,位于initialize> self.initialize_layers()>文件” /home/pandu/anaconda3/lib/python3.7/site-packages/nolearn-0.6.1.dev0-> py3.7.egg / nolearn / lasagne / base.py“,第609行,位于initialize_layers> chain_exception(TypeError(msg),e)中>文件“ /home/pandu/anaconda3/lib/python3.7/site-packages/nolearn-0.6.1.dev0->py3.7.egg/nolearn/_compat.py”,第25行,chain_exception> exec( “>从exc2”中提高exc1“)>文件”“,> TypeError中的第1行:无法使用args {'name':>'pool1','ds':(2,2),'incoming':}实例化。 >参数名称可能已更改?