Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some errors to run mnist_draw.py in examples #1

Open
lim0606 opened this issue May 7, 2015 · 3 comments
Open

Some errors to run mnist_draw.py in examples #1

lim0606 opened this issue May 7, 2015 · 3 comments

Comments

@lim0606
Copy link

lim0606 commented May 7, 2015

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
@mnomanmemon
Copy link

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

@aferriss
Copy link

aferriss commented Nov 5, 2015

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...

@MagicalFox
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants