lasagne-draw icon indicating copy to clipboard operation
lasagne-draw copied to clipboard

Some errors to run mnist_draw.py in examples

Open lim0606 opened this issue 9 years ago • 3 comments

Hi :)

Thanks a lot for your codes.

I tried to run mnist_draw.py in examples folder after installation, and I got some errors.

I solved the issues by following modifications. (I installed theano and lasagne with sudo)

  1. lasagne-draw/deepmodels/init.py change followings from . import confusionmatrix from . import layers from . import batchiterator to follows; import confusionmatrix import layers import batchiterator
  2. lasagne-draw/deepmodels/layers/init.py change followings from .base import * from .draw import * to as follows; from lasagne.layers.base import * from draw import *
  3. lasagne-draw/deepmodels/layers/draw.py line 8 comment out from .. import logdists

lim0606 avatar May 07 '15 07:05 lim0606

Hey, I have same error as you had. Did you solve the issue or not? If you solved the issue then let me know please. I also want to run the code.

Thanks

mnomanmemon avatar Oct 18 '15 12:10 mnomanmemon

I also go the same errors, and the fixes above seem to work. Except there are more errors to deal with as well.

On line 35 of draw.py I'm getting

TypeError: __init__() got an unexpected keyword argument 'avg'

Changing 35 to

ini = init.Normal(std=0.01)

silences this one. But then I am also getting an error on line 70

AttributeError: 'InputLayer' object has no attribute 'get_output_shape'

I found this link that suggested this was because of an api change in lasagne. So I changed it to

num_batch, num_inputs = self.input_layer.output_shape()

But now I get

TypeError: 'tuple' object is not callable

It looks like this is being called from line 81 of mnist_draw.py

grad_clip_vals_out=[-1.0,1.0])

But I'm not sure where to go next...

aferriss avatar Nov 05 '15 00:11 aferriss

@aferriss here are some more changes I made

  1. instead of
    num_batch, num_inputs = self.input_layer.output_shape() change it to import lasagne.layers num_batch, num_inputs = lasagne.layers.get_output_shape(self.input_layer) this may not be necessary but I did it anyway just to follow the lasagne's API
  2. in draw.py, replace all self.create_param by self.add_param, this is possibly due to an API change. Note: after this, there are some cases where () has to be changed to [] for the second parameter to self.add_param when error prompts says 'int' objects are not iterable.

and it starts training in my case.

MagicalFox avatar Nov 08 '15 23:11 MagicalFox