Python Theano:梯度误差

Python Theano:梯度误差,python,numpy,neural-network,enthought,theano,Python,Numpy,Neural Network,Enthought,Theano,我有一个复杂的架构,我正在计算梯度wrt到diff参数,但是我正在跟踪奇怪的错误,这是什么指示?我不知道为什么会出现这个错误 TypeError: Join.grad illegally returned an integer-valued variable. (Input index 1, dtype int32) 导致此错误的顺序步骤如下: File "/localDisk/work/workspaces/python/sc/src/learner.py", line 304, in c

我有一个复杂的架构,我正在计算梯度wrt到diff参数,但是我正在跟踪奇怪的错误,这是什么指示?我不知道为什么会出现这个错误

TypeError: Join.grad illegally  returned an integer-valued variable. (Input index 1, dtype int32)
导致此错误的顺序步骤如下:

File "/localDisk/work/workspaces/python/sc/src/learner.py", line 304, in createUpdates
currentGrad = T.grad(self.cost,p)
File "/Library/Python/2.7/site-packages/Theano/theano/gradient.py", line 438, in grad
outputs, wrt, consider_constant)
File "/Library/Python/2.7/site-packages/Theano/theano/gradient.py", line 809, in _populate_var_to_app_to_idx
account_for(output)
File "/Library/Python/2.7/site-packages/Theano/theano/gradient.py", line 805, in account_for
account_for(ipt)
File "/Library/Python/2.7/site-packages/Theano/theano/gradient.py", line 805, in account_for
account_for(ipt)
File "/Library/Python/2.7/site-packages/Theano/theano/gradient.py", line 805, in account_for
account_for(ipt)
File "/Library/Python/2.7/site-packages/Theano/theano/gradient.py", line 805, in account_for
account_for(ipt)
File "/Library/Python/2.7/site-packages/Theano/theano/gradient.py", line 805, in account_for
account_for(ipt)
File "/Library/Python/2.7/site-packages/Theano/theano/gradient.py", line 805, in account_for
account_for(ipt)
File "/Library/Python/2.7/site-packages/Theano/theano/gradient.py", line 805, in account_for
account_for(ipt)
File "/Library/Python/2.7/site-packages/Theano/theano/gradient.py", line 805, in account_for
account_for(ipt)
File "/Library/Python/2.7/site-packages/Theano/theano/gradient.py", line 805, in account_for
account_for(ipt)
File "/Library/Python/2.7/site-packages/Theano/theano/gradient.py", line 780, in account_for
connection_pattern = _node_to_pattern(app)
File "/Library/Python/2.7/site-packages/Theano/theano/gradient.py", line 665, in _node_to_pattern
connection_pattern = node.op.connection_pattern(node)
File "/Library/Python/2.7/site-packages/Theano/theano/scan_module/scan_op.py", line 1373, in connection_pattern
ils)
File "/Library/Python/2.7/site-packages/Theano/theano/scan_module/scan_op.py", line 1301, in compute_gradient
known_grads={y: g_y}, wrt=x)
File "/Library/Python/2.7/site-packages/Theano/theano/gradient.py", line 529, in grad
grad_dict, wrt, cost_name)
File "/Library/Python/2.7/site-packages/Theano/theano/gradient.py", line 1213, in _populate_grad_dict
rval = [access_grad_cache(elem) for elem in wrt]
File "/Library/Python/2.7/site-packages/Theano/theano/gradient.py", line 1173, in access_grad_cache
term = access_term_cache(node)[idx]
File "/Library/Python/2.7/site-packages/Theano/theano/gradient.py", line 895, in access_term_cache
output_grads = [access_grad_cache(var) for var in node.outputs]
File "/Library/Python/2.7/site-packages/Theano/theano/gradient.py", line 1173, in access_grad_cache
term = access_term_cache(node)[idx]
File "/Library/Python/2.7/site-packages/Theano/theano/gradient.py", line 895, in access_term_cache
output_grads = [access_grad_cache(var) for var in node.outputs]
File "/Library/Python/2.7/site-packages/Theano/theano/gradient.py", line 1173, in access_grad_cache
term = access_term_cache(node)[idx]
File "/Library/Python/2.7/site-packages/Theano/theano/gradient.py", line 1091, in access_term_cache
term.type.dtype))

TypeError: Join.grad illegally returned an integer-valued variable. (Input index 1, dtype int32)