CuriousAI / ladder

Ladder network is a deep learning algorithm that combines supervised and unsupervised learning
MIT License
516 stars 142 forks source link

Error running the code #3

Closed AtrejuArtax closed 9 years ago

AtrejuArtax commented 9 years ago

I run: run.py train --encoder-layers 1000-500-250-250-250-10 --decoder-spec sig --denoising-cost-x 1000,10,0.1,0.1,0.1,0.1,0.1 --labeled-samples 100 --unlabeled-samples 60000 --seed 1 -- mnist_100_full I get: File "run.py", line 649, in if train(d) is None: File "run.py", line 405, in train in_dim, data, whiten, cnorm = setup_data(p, test_set=False) File "run.py", line 240, in setup_data train_set = dataset_class("train") File "/usr/local/lib/python2.7/dist-packages/fuel/datasets/mnist.py", line 37, in init which_sets=which_sets, kwargs) File "/usr/local/lib/python2.7/dist-packages/fuel/datasets/hdf5.py", line 179, in init** raise ValueError('which_sets should be an iterable of strings') ValueError: which_sets should be an iterable of strings

How could I solve this? Thanks in advance.

arasmus commented 9 years ago

It's related to Fuel/Blocks version that you use. The code was developed against v0.0.1 tag and you are likely using newer.

You have two ways to fix it: A. Downgrade your Fuel and Blocks version 0.0.1. B. Update the code. The change will look somewhat similar to this https://github.com/udibr/ladder/commit/b9a242b624ab1469eaf06d731016941a968ed0e8

arasmus commented 9 years ago

Closing, please reopen or file a new issue if my solution did not fix it.

AtrejuArtax commented 9 years ago

First of all sorry for not to tell you anything. Secondly, I am still stuck on this. I did exactly what you say in the README. The blocks and Fuel versions are:

Name: blocks Version: 0.0.1 Location: /usr/local/lib/python2.7/dist-packages Requires: numpy, six, pyyaml, pandas, toolz, theano, picklable-itertools, progressbar2, fuel

Name: fuel Version: 0.0.1 Location: /usr/local/lib/python2.7/dist-packages Requires: six, picklable-itertools, pyyaml, h5py, tables, progressbar2, pyzmq

But when I run for example:

./run.py train --encoder-layers convv:96:3:1:1-convf:96:3:1:1-convf:96:3:1:1-maxpool:2:2-convv:192:3:1:1-convf:192:3:1:1-convv:192:3:1:1-maxpool:2:2-convv:192:3:1:1-convv:192:1:1:1-convv:10:1:1:1-globalmeanpool:0 --decoder-spec 0-0-0-0-0-0-0-0-0-0-0-0-sig --dataset cifar10 --act leakyrelu --denoising-cost-x 0,0,0,0,0,0,0,0,0,0,0,0,4.0 --num-epochs 70 --lrate-decay 0.86 --seed 1 --whiten-zca 3072 --contrast-norm 55 --top-c False --labeled-samples 4000 --unlabeled-samples 50000 -- cifar_4k_gamma

I get this error:

Traceback (most recent call last): File "./run.py", line 649, in if train(d) is None: File "./run.py", line 410, in train ladder = setup_model(p) File "./run.py", line 181, in setup_model ladder.apply(x, y, x_only) File "/home/claudi/ladder/ladder.py", line 194, in apply clean = self.act.clean = encoder(input_concat, 'clean') File "/home/claudi/ladder/ladder.py", line 182, in encoder noise_std=noise) File "/home/claudi/ladder/ladder.py", line 345, in f z, output_size = self.f_conv(h, spec, in_dim, gen_id('W')) File "/home/claudi/ladder/ladder.py", line 446, in f_conv filter_size), border_mode=bm) File "/usr/local/lib/python2.7/dist-packages/theano/tensor/nnet/conv.py", line 151, in conv2d return op(input, filters) File "/usr/local/lib/python2.7/dist-packages/theano/gof/op.py", line 507, in call node = self.make_node(_inputs, *_kwargs) File "/usr/local/lib/python2.7/dist-packages/theano/tensor/nnet/conv.py", line 628, in make_node "inputs(%s), kerns(%s)" % (_inputs.dtype, _kerns.dtype)) NotImplementedError: The image and the kernel must have the same type.inputs(float64), kerns(float32)

I also tried to change the code as you suggested (instead of install the right fuel version) and for that error it worked but then I had another error, and another one, and another one like a never ending story. So thank you for your time and if you can still help me I will really appreciate it.