HINT: Re-running with most Theano optimization disabled could give you a back-traces when this node was created. This can be done with by setting the Theano flags optimizer=fast_compile
HINT: Use the Theano flag 'exception_verbosity=high' for a debugprint of this apply node.
Arguably the most useful information is approximately half-way through
the error message, where the kind of error is displayed along with its
cause (`ValueError: Input dimension mis-match. (input[0].shape[0] = 3,
input[1].shape[0] = 2`).
Below it, some other information is given, such as the apply node that
caused the error, as well as the input types, shapes, strides and
scalar values.
The two hints can also be helpful when debugging. Using the theano flag
``optimizer=fast_compile`` can in some cases tell you the faulty line,
while ``exception_verbosity=high`` will display a debugprint of the
apply node. Using these hints, the end of the error message becomes :
.. code-block:: bash
Backtrace when the node is created:
File "/opt/lisa/os/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2690, in run_ast_nodes
if self.run_code(code):
File "/opt/lisa/os/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2746, in run_code
exec code_obj in self.user_global_ns, self.user_ns
File "<ipython-input-1-902f5bb7425a>", line 8, in <module>
HINT: Re-running with most Theano optimization disabled could give you a back-traces when this node was created. This can be done with by setting the Theano flags optimizer=fast_compile
If the above is not informative enough, by instrumenting the code ever
so slightly, we can get Theano to reveal the exact source of the error.
.. code-block:: python
.. code-block:: python
...
@@ -108,18 +209,46 @@ value. This allows Theano to evaluate symbolic expressions on-the-fly (by
...
@@ -108,18 +209,46 @@ value. This allows Theano to evaluate symbolic expressions on-the-fly (by
calling the ``perform`` method of each op), as they are being defined. Sources
calling the ``perform`` method of each op), as they are being defined. Sources
of error can thus be identified with much more precision and much earlier in
of error can thus be identified with much more precision and much earlier in
the compilation pipeline. For example, running the above code yields the
the compilation pipeline. For example, running the above code yields the
following error message, which properly identifies *line 23* as the culprit.
following error message, which properly identifies *line 24* as the culprit.