How to pass arrays to callbacks?
In a previous version of pytorch lightning I could return a dictionary in the method validation_epoch_end and then the content of the dictionary would automatically populate trainer.callback_metrics. I can then use this in my callbacks.
However, if I try this in 1.4.8, trainer.callback_metrics is an empty dictionary.
Do you suggest any alternative? Calling self.log is not an option, because it cannot log np.ndarrays:
self.log(val_output, [[array]])` was called, but `ndarray` values cannot be logged
At the end, what I do is to place the dictionary as a new member (e.g. self.extra_data). Then, from the callback I can access it pl_module.extra_data. I guess it is not clean, but it works.