AWSGPU_DeepLearning icon indicating copy to clipboard operation
AWSGPU_DeepLearning copied to clipboard

Instructions given to make kfkd.py run seem to fail

Open shashankchaudhry opened this issue 9 years ago • 3 comments

Hi Im not sure if you are still supporting this code, but I just wanted to inform you that the code doesn't seem to be working. Firstly, matplotlib was not installing, which I fixed by installing the following two packages before running setup.sh: sudo apt-get install libpng-dev sudo apt-get install libfreetype6-dev But even despite this when I follow your steps of using the community AMI, and running the shell script, I get the following error: Traceback (most recent call last): File "AWSGPU_DeepLearning/kfkd.py", line 116, in net2.fit(X, y) File "/usr/local/lib/python2.7/dist-packages/nolearn/lasagne/base.py", line 290, in fit self.initialize() File "/usr/local/lib/python2.7/dist-packages/nolearn/lasagne/base.py", line 149, in initialize out = self._output_layer = self.initialize_layers() File "/usr/local/lib/python2.7/dist-packages/nolearn/lasagne/base.py", line 226, in initialize_layers chain_exception(TypeError(msg), e) File "/usr/local/lib/python2.7/dist-packages/nolearn/_compat.py", line 11, in chain_exception exec("raise exc1, None, sys.exc_info()[2]") File "/usr/local/lib/python2.7/dist-packages/nolearn/lasagne/base.py", line 221, in initialize_layers layer = layer_factory(**layer_kw) TypeError: Failed to instantiate <class 'lasagne.layers.cuda_convnet.MaxPool2DCCLayer'> with args {'incoming': <lasagne.layers.cuda_convnet.Conv2DCCLayer object at 0x7f2dc82c0b90>, 'name': 'pool1', 'ds': (2, 2)}. Maybe parameter names have changed?

shashankchaudhry avatar Aug 26 '15 13:08 shashankchaudhry

I am getting the same error as above.

mjasek114 avatar Mar 24 '16 05:03 mjasek114

I am also getting this error

Liquid-Thinking avatar Jul 14 '16 19:07 Liquid-Thinking

To fix this issue, replace net2 with the following code

I believe cuda_convnet layers needs to be initialized.

net2 = NeuralNet(
    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),
        ],
    input_shape=(None, 1, 96, 96),
    conv1_num_filters=32, conv1_filter_size=(3, 3), pool1_pool_size=(2, 2),
    conv2_num_filters=64, conv2_filter_size=(2, 2), pool2_pool_size=(2, 2),
    conv3_num_filters=128, conv3_filter_size=(2, 2), pool3_pool_size=(2, 2),
    hidden4_num_units=500, hidden5_num_units=500,
    output_num_units=30, output_nonlinearity=None,

    update_learning_rate=0.01,
    update_momentum=0.9,

    regression=True,
    max_epochs=1000,
    verbose=1,
    )

rohit-nair avatar Nov 03 '16 06:11 rohit-nair