tensorflow / haskell

Haskell bindings for TensorFlow
https://tensorflow.github.io/haskell/haddock/
Apache License 2.0
1.58k stars 196 forks source link

Include haskell source location in error messages #24

Open fkm3 opened 8 years ago

fkm3 commented 8 years ago

Many times errors from the underlying tensorflow implementation refer to the names of op nodes and it isn't obvious what haskell code generated those nodes. withNameScope can be used to help find the offending nodes, but that technique isn't ideal.

One idea is to record the line number (or entire call stack) for every node we create, then, when an error occurs we can attempt to parse the node names out of the error message and display their locations alongside the original error. If parsing the error message is too difficult, maybe we can dump the entire mapping to a log file on error.

Another idea is to expand the tensorflow C API to allow some metadata to be passed along with each node. When an error occurs, the metadata for the relevant nodes would be included.

silky commented 8 years ago

this would be amazing!