Siamese-LSTM
Siamese-LSTM copied to clipboard
while training got Error
Kindly help ASAP to resolve the issus. i couldnot get the problem while training and running the Example3
File "/home/seemab/seemab/LSTM/example3.py", line 6, in
File "/home/seemab/seemab/LSTM/lstm.py", line 289, in init gradi = tensor.grad(cost, wrt=tnewp.values())#/bts
File "/usr/local/lib/python3.5/dist-packages/theano/gradient.py", line 502, in grad " of type " + str(type(elem)))
TypeError: Expected Variable, got odict_values([1lstm1_U, 1lstm1_W, 1lstm1_b, 2lstm1_U, 2lstm1_W, 2lstm1_b]) of type <class 'odict_values'>
In lstm.py
import os os.environ["THEANO_FLAGS"] = "mode=FAST_RUN,floatX=float32" import theano.tensor as T
你好,我也遇到了这个问题,把这句话加上并没有解决我的问题啊,请问您的环境是什么样的呢?
I face the same error with theano (version 1.0.4) while running different code. @aimaaonline suggestion didn't work. I was able to fix the problem when I passed a list to the grad function as follows tensor.grad(cost, wrt=list(tnewp.values()))