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.
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.