Mismatch Type TensorType (float64, row) TensorType (float64, matrix)

I am trying to run this program https://github.com/npow/ubottu to create a model for Ubuntu Dialog Corpus

He uses Theano and Lasagne as dependencies.

when I install Theano and Lasagne from pip, and make simple

import lasagne

I get an error

from theano.tensor.signal import downsample
ImportError: cannot import name 'downsample'

then found a workaround here, Climbing against a possible version mismatch of Theano (Windows), the suggestion was to install Theano and Lasagne from their main github branches respectively.

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

This removed the above erorr, but I get the following error.

TypeError: ('An update must have the same type as the original shared variable (shared_var=hid_init, shared_var.type=TensorType(float64, row), update_val=Elemwise{sub,no_inplace}.0, update_val.type=TensorType(float64, matrix)).', 'If the difference is related to the broadcast pattern, you can call the tensor.unbroadcast(var, axis_to_unbroadcast[, ...]) function to remove broadcastable dimensions.')

there seems to be a type mismatch somewhere. a row type variable is updated with a matrix type value. Full trace:

Traceback (most recent call last):
  File "main.py", line 669, in <module>
    main()
  File "main.py", line 661, in main
    model = Model(**args.__dict__)
  File "main.py", line 375, in __init__
    self.update_params()
  File "main.py", line 408, in update_params
    self.train_model = theano.function([], self.cost, updates=updates, givens=givens, on_unused_input='warn')
  File "/home/vimal/anaconda2/lib/python2.7/site-packages/theano/compile/function.py", line 326, in function
    output_keys=output_keys)
  File "/home/vimal/anaconda2/lib/python2.7/site-packages/theano/compile/pfunc.py", line 449, in pfunc
    no_default_updates=no_default_updates)
  File "/home/vimal/anaconda2/lib/python2.7/site-packages/theano/compile/pfunc.py", line 208, in rebuild_collect_shared
    raise TypeError(err_msg, err_sug)
TypeError: ('An update must have the same type as the original shared variable (shared_var=cell_init, shared_var.type=TensorType(float64, row), update_val=Elemwise{sub,no_inplace}.0, update_val.type=TensorType(float64, matrix)).', 'If the difference is related to the broadcast pattern, you can call the tensor.unbroadcast(var, axis_to_unbroadcast[, ...]) function to remove broadcastable dimensions.')

version

>>> import theano as th
>>> print th.__version__
0.10.0dev1.dev-RELEASE


>>> import lasagne as la
>>> print la.__version__
0.2.dev1

?

0

Source: https://habr.com/ru/post/1654635/


All Articles