Discussion:
[theano-users] Find the variable that causes DisconnectedInputError
Mathias Müller
2017-11-01 13:37:37 UTC
Permalink
Hi,

I am getting the following theano error:

Traceback (most recent call last):
File "/home/user/mmueller/nematus-context2/nematus/nmt.py", line 1995, in
<module>
train(**vars(args))
File "/home/user/mmueller/nematus-context2/nematus/nmt.py", line 1439, in
train
grads = tensor.grad(cost, wrt=itemlist(updated_params))
File
"/home/user/mmueller/.pythonz/pythons/CPython-2.7.13/lib/python2.7/site-packages/theano/gradient.py"
, line 539, in grad
handle_disconnected(elem)
File
"/home/user/mmueller/.pythonz/pythons/CPython-2.7.13/lib/python2.7/site-packages/theano/gradient.py"
, line 526, in handle_disconnected
raise DisconnectedInputError(message)
theano.gradient.DisconnectedInputError:
Backtrace when that variable is created:

File "/home/user/mmueller/nematus-context2/nematus/nmt.py", line 1995, in
<module>
train(**vars(args))
File "/home/user/mmueller/nematus-context2/nematus/nmt.py", line 1377, in
train
tparams = init_theano_params(params)
File "/home/user/mmueller/nematus-context2/nematus/theano_util.py", line
57, in init_theano_params
tparams[kk] = theano.shared(params[kk], name=kk)


As far as I understand, this means that I am requesting the gradient with
respect to a variable that was not used to compute the cost.

My model has a large number of theano variables, and I find the error
message a bit uninformative. *How can I find out which variable is causing
this error?*

$ python -c "import theano; print theano.version.version"
0.9.0


Thanks so much,
Mathias
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Frédéric Bastien
2017-11-03 13:38:30 UTC
Permalink
Update to Theano 1.0rc1. We updated error information heavily and I think
it will help your case:
https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end(gpuarray)
Post by Mathias Müller
Hi,
File "/home/user/mmueller/nematus-context2/nematus/nmt.py", line 1995,
in <module>
train(**vars(args))
File "/home/user/mmueller/nematus-context2/nematus/nmt.py", line 1439,
in train
grads = tensor.grad(cost, wrt=itemlist(updated_params))
File
"/home/user/mmueller/.pythonz/pythons/CPython-2.7.13/lib/python2.7/site-packages/theano/gradient.py"
, line 539, in grad
handle_disconnected(elem)
File
"/home/user/mmueller/.pythonz/pythons/CPython-2.7.13/lib/python2.7/site-packages/theano/gradient.py"
, line 526, in handle_disconnected
raise DisconnectedInputError(message)
File "/home/user/mmueller/nematus-context2/nematus/nmt.py", line 1995,
in <module>
train(**vars(args))
File "/home/user/mmueller/nematus-context2/nematus/nmt.py", line 1377,
in train
tparams = init_theano_params(params)
File "/home/user/mmueller/nematus-context2/nematus/theano_util.py",
line 57, in init_theano_params
tparams[kk] = theano.shared(params[kk], name=kk)
As far as I understand, this means that I am requesting the gradient with
respect to a variable that was not used to compute the cost.
My model has a large number of theano variables, and I find the error
message a bit uninformative. *How can I find out which variable is
causing this error?*
$ python -c "import theano; print theano.version.version"
0.9.0
Thanks so much,
Mathias
--
---
You received this message because you are subscribed to the Google Groups
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Mathias Müller
2017-11-08 09:12:07 UTC
Permalink
Thanks for your answer Fred! Ok, I will upgrade. I also noticed that using
the new GPU backend gpuarray also changed the error messages for the better
(= more informative).
Post by Frédéric Bastien
Update to Theano 1.0rc1. We updated error information heavily and I think
https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end(gpuarray)
Post by Mathias Müller
Hi,
File "/home/user/mmueller/nematus-context2/nematus/nmt.py", line 1995,
in <module>
train(**vars(args))
File "/home/user/mmueller/nematus-context2/nematus/nmt.py", line 1439,
in train
grads = tensor.grad(cost, wrt=itemlist(updated_params))
File
"/home/user/mmueller/.pythonz/pythons/CPython-2.7.13/lib/python2.7/site-packages/theano/gradient.py"
, line 539, in grad
handle_disconnected(elem)
File
"/home/user/mmueller/.pythonz/pythons/CPython-2.7.13/lib/python2.7/site-packages/theano/gradient.py"
, line 526, in handle_disconnected
raise DisconnectedInputError(message)
File "/home/user/mmueller/nematus-context2/nematus/nmt.py", line 1995,
in <module>
train(**vars(args))
File "/home/user/mmueller/nematus-context2/nematus/nmt.py", line 1377,
in train
tparams = init_theano_params(params)
File "/home/user/mmueller/nematus-context2/nematus/theano_util.py",
line 57, in init_theano_params
tparams[kk] = theano.shared(params[kk], name=kk)
As far as I understand, this means that I am requesting the gradient with
respect to a variable that was not used to compute the cost.
My model has a large number of theano variables, and I find the error
message a bit uninformative. *How can I find out which variable is
causing this error?*
$ python -c "import theano; print theano.version.version"
0.9.0
Thanks so much,
Mathias
--
---
You received this message because you are subscribed to the Google Groups
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...