{"action":"closed","issue":{"url":"https://api.github.com/repos/dnouri/nolearn/issues/83","labels_url":"https://api.github.com/repos/dnouri/nolearn/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/dnouri/nolearn/issues/83/comments","events_url":"https://api.github.com/repos/dnouri/nolearn/issues/83/events","html_url":"https://github.com/dnouri/nolearn/issues/83","id":71956858,"number":83,"title":"TypeError with convolutional layer: __init__() takes at least 3 arguments","user":{"login":"Rachnog","id":6622827,"avatar_url":"https://avatars.githubusercontent.com/u/6622827?v=3","gravatar_id":"","url":"https://api.github.com/users/Rachnog","html_url":"https://github.com/Rachnog","followers_url":"https://api.github.com/users/Rachnog/followers","following_url":"https://api.github.com/users/Rachnog/following{/other_user}","gists_url":"https://api.github.com/users/Rachnog/gists{/gist_id}","starred_url":"https://api.github.com/users/Rachnog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rachnog/subscriptions","organizations_url":"https://api.github.com/users/Rachnog/orgs","repos_url":"https://api.github.com/users/Rachnog/repos","events_url":"https://api.github.com/users/Rachnog/events{/privacy}","received_events_url":"https://api.github.com/users/Rachnog/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-29T18:53:49Z","updated_at":"2015-04-30T14:52:02Z","closed_at":"2015-04-30T14:52:02Z","body":"Hello, guys!\r\n\r\nEverything worked really well with Lasagne and Nolearn,\r\nuntil I reinstalled my Ubuntu. I've configured everything and ran some tests like lasagne tutorials and everything was okay,\r\nso I wanted to use my old code with network like:\r\n\r\n```\r\nnet2 = NeuralNet(\r\n    layers=[\r\n        ('input', layers.InputLayer),\r\n        ('conv1', layers.Conv2DLayer),\r\n        ('pool1', layers.MaxPool2DLayer),\r\n        ('conv2', layers.Conv2DLayer),\r\n        ('pool2', layers.MaxPool2DLayer),\r\n        ('conv3', layers.Conv2DLayer),\r\n        ('pool3', layers.MaxPool2DLayer),\r\n        ('hidden4', layers.DenseLayer),\r\n        ('hidden5', layers.DenseLayer),\r\n        ('output', layers.DenseLayer),\r\n        ],\r\n    input_shape=(None, 3, PIXELS, PIXELS),\r\n    conv1_num_filters=32, conv1_filter_size=(3, 3), pool1_ds=(2, 2),\r\n    conv2_num_filters=64, conv2_filter_size=(2, 2), pool2_ds=(2, 2),\r\n    conv3_num_filters=128, conv3_filter_size=(2, 2), pool3_ds=(2, 2),\r\n    hidden4_num_units=500, hidden5_num_units=500,\r\n    output_num_units=50, output_nonlinearity=nonlinearities.softmax,\r\n    update_learning_rate=0.01,\r\n    update_momentum=0.9,\r\n    regression=False,\r\n    max_epochs=1000,\r\n    verbose=1,\r\n        # Training test-set split\r\n    eval_size = 0.2\r\n    )\r\n```\r\n\r\nIn fact it was a bit larger, but whatever. And it gives me such error:\r\n\r\n```\r\n Start training...\r\n/usr/local/lib/python2.7/dist-packages/Lasagne-0.1dev-py2.7.egg/lasagne/init.py:86: UserWarning: The uniform initializer no longer uses Glorot et al.'s approach to determine the bounds, but defaults to the range (-0.01, 0.01) instead. Please use the new GlorotUniform initializer to get the old behavior. GlorotUniform is now the default for all layers.\r\n  warnings.warn(\"The uniform initializer no longer uses Glorot et al.'s \"\r\nTraceback (most recent call last):\r\n  File \"las_mnist.py\", line 200, in <module>\r\n    net2.fit(X, y)\r\n  File \"/usr/local/lib/python2.7/dist-packages/nolearn/lasagne.py\", line 138, in fit\r\n    out = self._output_layer = self.initialize_layers()\r\n  File \"/usr/local/lib/python2.7/dist-packages/nolearn/lasagne.py\", line 369, in initialize_layers\r\n    layer = layer_factory(layer, **layer_params)\r\nTypeError: __init__() takes at least 3 arguments (2 given)\r\n```\r\n\r\nWhy I think, it's something with convolutions,\r\nbecause network with DenseLayers and Dropouts only runs well:\r\n\r\n```\r\nnet1 = NeuralNet(\r\n    layers=[\r\n        ('input', layers.InputLayer),\r\n        ('hidden1', layers.DenseLayer),\r\n        ('dropout1', layers.DropoutLayer),  # !\r\n        ('hidden2', layers.DenseLayer),\r\n        ('dropout2', layers.DropoutLayer),  # !\r\n        ('hidden3', layers.DenseLayer),\r\n        ('dropout3', layers.DropoutLayer),  # !\r\n        ('output', layers.DenseLayer),\r\n        ],\r\n    input_shape=(None, 3, PIXELS, PIXELS), #None in the first axis indicates that the batch size can be set later\r\n    dropout1_p=0.5,  # !\r\n    hidden1_num_units=2000,\r\n    dropout2_p=0.5,  # !\r\n    hidden2_num_units=1000,\r\n    dropout3_p=0.5,  # !\r\n    hidden3_num_units=500,\r\n\r\n    output_num_units=50, output_nonlinearity=nonlinearities.softmax,\r\n    # learning rate parameters\r\n    update_learning_rate=0.01,\r\n    update_momentum=0.9,\r\n    regression=False,\r\n    # We only train for 10 epochs\r\n    max_epochs=100,\r\n    verbose=1,\r\n    # Training test-set split\r\n    eval_size = 0.2\r\n        )\r\n```\r\n \r\nPlease help me, if you have some ideas how to handle it.\r\nThank you very much!"}}