Hi Jesse,
I’ve got some time again to try and get this done
I’m getting the following error when trying the print ops: ValueError: Length of DropDims{axis=0}.0 cannot be determined
.
Hi Jesse,
I’ve got some time again to try and get this done
I’m getting the following error when trying the print ops: ValueError: Length of DropDims{axis=0}.0 cannot be determined
.
There’s a typo in my code
pytensor.printing.Print
creates an Op class instance that you then need to pass item
into. The class initializer has a single argument, the name of the object being printed. So the correct syntax is:
loss_or_grads = [pytensor.printing.Print(f'loss_item_{i}')(item) for i, item in enumerate(loss_or_grads)]
Ahh, sorry didn’t notice.
I’ve actually tried using a callback—rather than wrapping the optimiser—and got things working. I kind of like using a callback better, probably because I’m used to keras. Shall I open a PR and move the discussion there?
Yea sounds great, just tag me on the PR