You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To debug my dolfin-adjoint code I want to visualize the compute graph.
I receive this error after calling tape.visualize():
File "/home/anaconda3/envs/masters_thesis/lib/python3.10/site-packages/tensorflow/python/ops/script_ops.py", line 632, in py_func_common
result = func(*[np.array(x) for x in inp])
TypeError: Tape._tf_add_blocks.<locals>.<lambda>() takes 0 positional arguments but 2 were given
This is fixed by the following:
try:
result = func(*[np.array(x) for x in inp])
except:
result = None
inspired from the following lines of tape.py, where one sees that a lambda with zero args is eventually called with more than zero inputs:
I'm not familiar with the tensorflow-based visualisation so I'll leave the direct part to others. However, if you are using pyadjoint master then direct PDF visualisation is also supported and could be a workaround. If you pass a filename ending in .pdf then you get a PDF visualisation. E.g. tape.visualise("tape.pdf"). This requires the python package networkx and the system package graphviz (e.g. sudo apt install graphviz).
leom97
changed the title
No graph is build for visualization
No graph is built for visualization
Jul 23, 2022
@dham This does indeed work, although the resulting pdf visualization if quite hard to read, without the possibility to expand and collapse blocks. Thank you for the answer in the meantime.
To debug my dolfin-adjoint code I want to visualize the compute graph.
I receive this error after calling
tape.visualize()
:This is fixed by the following:
inspired from the following lines of tape.py, where one sees that a lambda with zero args is eventually called with more than zero inputs:
Anyhow, tensorboard now says empty graph, so that nothing is visualized. How can this be solved?
The text was updated successfully, but these errors were encountered: