mgermain / MADE

MADE: Masked Autoencoder for Distribution Estimation
100 stars 20 forks source link

TypeError: Cannot convert Type TensorType(float32, matrix) (of Variable Subtensor{int64:int64:}.0) into Type TensorType(float64, matrix). You can try to manually convert Subtensor{int64:int64:}.0 into a TensorType(float64, matrix). #2

Open hatimuradin opened 7 years ago

hatimuradin commented 7 years ago

I just tried to run your code like the example in the README file: nobody:MADE-ICML2015 apple$ python -u trainMADE.py dna 1e-5 0.95 -1 -1 Full 300 100 30 False 0 adadelta 0 [500] 1234 False Output False hinge Orthogonal 0

DEPRECATION WARNING: softsign was moved from theano.sandbox.softsign to theano.tensor.nnet.nnet

Resuming experiment (ef0f220f13f115d34798a5f7e16e8c539e4eaee42564d07ed8f893b7fadaa8a0).

Loading dataset [dna] ... (Dim:180 Train:1400 Valid:600 Test:1186) DONE in 0.0163 seconds.

Initializing MADE ...

Traceback (most recent call last): File "trainMADE.py", line 287, in model = build_model(dataset, trainingparams, hyperparams, hyperparams['hidden_sizes']) File "trainMADE.py", line 140, in build_model mask_distribution=hyperparams['mask_distribution']) File "/Users/apple/Desktop/Thesis/MADE-ICML2015/MADE/made.py", line 129, in init on_unused_input='ignore') # ignore for when dropout is absent File "/Users/apple/miniconda2/lib/python2.7/site-packages/theano/compile/function.py", line 326, in function output_keys=output_keys) File "/Users/apple/miniconda2/lib/python2.7/site-packages/theano/compile/pfunc.py", line 449, in pfunc no_default_updates=no_default_updates) File "/Users/apple/miniconda2/lib/python2.7/site-packages/theano/compile/pfunc.py", line 219, in rebuild_collect_shared cloned_v = clone_v_get_shared_updates(v, copy_inputs_over) File "/Users/apple/miniconda2/lib/python2.7/site-packages/theano/compile/pfunc.py", line 93, in clone_v_get_shared_updates clone_v_get_shared_updates(i, copy_inputs_over) File "/Users/apple/miniconda2/lib/python2.7/site-packages/theano/compile/pfunc.py", line 93, in clone_v_get_shared_updates clone_v_get_shared_updates(i, copy_inputs_over) File "/Users/apple/miniconda2/lib/python2.7/site-packages/theano/compile/pfunc.py", line 93, in clone_v_get_shared_updates clone_v_get_shared_updates(i, copy_inputs_over) File "/Users/apple/miniconda2/lib/python2.7/site-packages/theano/compile/pfunc.py", line 93, in clone_v_get_shared_updates clone_v_get_shared_updates(i, copy_inputs_over) File "/Users/apple/miniconda2/lib/python2.7/site-packages/theano/compile/pfunc.py", line 93, in clone_v_get_shared_updates clone_v_get_shared_updates(i, copy_inputs_over) File "/Users/apple/miniconda2/lib/python2.7/site-packages/theano/compile/pfunc.py", line 93, in clone_v_get_shared_updates clone_v_get_shared_updates(i, copy_inputs_over) File "/Users/apple/miniconda2/lib/python2.7/site-packages/theano/compile/pfunc.py", line 93, in clone_v_get_shared_updates clone_v_get_shared_updates(i, copy_inputs_over) File "/Users/apple/miniconda2/lib/python2.7/site-packages/theano/compile/pfunc.py", line 93, in clone_v_get_shared_updates clone_v_get_shared_updates(i, copy_inputs_over) File "/Users/apple/miniconda2/lib/python2.7/site-packages/theano/compile/pfunc.py", line 96, in clone_v_get_shared_updates [clone_d[i] for i in owner.inputs], strict=rebuild_strict) File "/Users/apple/miniconda2/lib/python2.7/site-packages/theano/gof/graph.py", line 238, in clone_with_new_inputs new_inputs[i] = curr.type.filter_variable(new) File "/Users/apple/miniconda2/lib/python2.7/site-packages/theano/tensor/type.py", line 235, in filter_variable self=self)) TypeError: Cannot convert Type TensorType(float32, matrix) (of Variable Subtensor{int64:int64:}.0) into Type TensorType(float64, matrix). You can try to manually convert Subtensor{int64:int64:}.0 into a TensorType(float64, matrix).

mgermain commented 7 years ago

3 things from the top of my head.

  1. Delete experiments/ef0f220f13f115d34798a5f7e16e8c539e4eaee42564d07ed8f893b7fadaa8a0
  2. Make sure your theano is in float32.
  3. You might take a look at the head which has been updated to be compatible with he new version and backend of Theano.

Should not be necessary be here's my ~/.theanorc:

[global]
device=cuda
#device=gpu
floatX=float32
exception_verbosity=high
#lib.cnmem=0.85
gpuarray.preallocate=0.85

[nvcc]
fastmath = True

The commented parts are for the old backend.

hatimuradin commented 7 years ago

I appreciate your help, my foat32 problem solved by configuring theanorc file.

mgermain commented 7 years ago

Great.