Neural-Photo-Editor icon indicating copy to clipboard operation
Neural-Photo-Editor copied to clipboard

Which library versions are used?

Open phiresky opened this issue 7 years ago • 4 comments

I got

Traceback (most recent call last):
  File "NPE.py", line 57, in <module>
    config_module = imp.load_source('config',config_path)
  File "IAN_simple.py", line 12, in <module>
    from lasagne.layers import batch_norm as BN
ImportError: cannot import name batch_norm

when trying to run this with stable lasagne.

That appears to be fixed after running

sudo pip2 install --upgrade https://github.com/Theano/Theano/archive/master.zip
sudo pip2 install --upgrade https://github.com/Lasagne/Lasagne/archive/master.zip

But now I get

Compiling Theano Functions
Traceback (most recent call last):
  File "NPE.py", line 75, in <module>
    Xh = lasagne.layers.get_output(model['l_out'],{model['l_latents']:ZZ},deterministic=True)
  File "/usr/lib/python2.7/site-packages/lasagne/layers/helper.py", line 191, in get_output
    all_outputs[layer] = layer.get_output_for(layer_inputs, **kwargs)
  File "/usr/lib/python2.7/site-packages/lasagne/layers/conv.py", line 330, in get_output_for
    conved = self.convolve(input, **kwargs)
  File "/home/tehdog/data/tmp/nobackup/pkg/Neural-Photo-Editor/layers.py", line 277, in convolve
    img = gpu_contiguous(input)
  File "/usr/lib/python2.7/site-packages/theano/gof/op.py", line 602, in __call__
    node = self.make_node(*inputs, **kwargs)
  File "/usr/lib/python2.7/site-packages/theano/sandbox/cuda/basic_ops.py", line 3963, in make_node
    input = as_cuda_ndarray_variable(input)
  File "/usr/lib/python2.7/site-packages/theano/sandbox/cuda/basic_ops.py", line 46, in as_cuda_ndarray_variable
    return gpu_from_host(tensor_x)
  File "/usr/lib/python2.7/site-packages/theano/gof/op.py", line 602, in __call__
    node = self.make_node(*inputs, **kwargs)
  File "/usr/lib/python2.7/site-packages/theano/sandbox/cuda/basic_ops.py", line 139, in make_node
    dtype=x.dtype)()])
  File "/usr/lib/python2.7/site-packages/theano/sandbox/cuda/type.py", line 95, in __init__
    (self.__class__.__name__, dtype, name))
TypeError: CudaNdarrayType only supports dtype float32 for now. Tried using dtype float64 for variable None

Can you elaborate which exact versions of the libraries you are using?

phiresky avatar Sep 23 '16 18:09 phiresky

I solved that problem by installing lasagne like

pip install https://github.com/Lasagne/Lasagne/archive/master.zip

Ubuntu 16.04 x64

ruXlab avatar Sep 23 '16 18:09 ruXlab

I solved it by creating the file ~/.theanorc as described in https://github.com/dnouri/kfkd-tutorial/issues/5#issuecomment-68589651 .

Some information about using Lasagne master should probably be added to the readme, and maybe something about theanorc too (not sure if that is obvious, have not used theano like this before).

phiresky avatar Sep 23 '16 18:09 phiresky

Hi guys,

I'm using the dev versions of both libraries (so Theano 0.9.0dev2 and lasagne 0.2dev1), and I've got the standard theano flags set to floatX=float32 and time_once for all the DNN flags. I didn't anticipate getting people outside of a relatively small academic community looking at any of this, so I'll be sure to update the readme with something a bit more user-friendly soon.

ajbrock avatar Sep 23 '16 21:09 ajbrock

Thanks.

I didn't anticipate getting people outside of a relatively small academic community looking at any of this

Well you did post it on reddit :) I'm just happy you published actual, running code together with your paper, which seems to happen far too seldom in my opinion.

phiresky avatar Sep 23 '16 21:09 phiresky