Support parsing tensors without requiring tensorboard
I find it a bit odd that tbparse requires tensorboard in order to parse tensor type logs, even if those are generated e.g. by pytorch. Ideally this could be supported out of the box with just pandas (and hence numpy).
Is there a technical reason for this limitation? I would think that the results could be parsed into pytorch tensors or numpy arrays in the same way?
tensor events are parsed with TensorFlow with the following code:
https://github.com/j3soon/tbparse/blob/74e89db0e9a088382babef3df0eab3f44120bb82/tbparse/summary_reader.py#L684-L687
The main usage of TensorFlow is for converting TensorProto to a numpy array. We require TensorFlow here since we don't want to manually perform the conversion. To the best of my knowledge, there is no simple alternative instead of tf.make_ndarray.
If you happen to know an alternative way for such a conversion, please let me know. Thanks!
We do something manually like this here: https://github.com/mshvartsman/Ax/blob/submitit-runner/ax/metrics/tensorboard.py#L112-L123
it's a bit pedestrian but it works. Presumably tf.make_ndarray doesn't do things much smarter? Depending on how it's implemented it may be faster though (haven't checked)
Thanks! Seems like TensorFlow does something similar (but dealing with more cases):
https://github.com/tensorflow/tensorflow/blob/39f68b781b04014252b01cfb65aabc25448a1ae1/tensorflow/python/framework/tensor_util.py#L630
However, I think we still need to follow the TensorFlow implementation, since the histogram event will log an entire tensor instead of a scalar.
If you have time, I would appreciate it if you could open a PR to fix this. Otherwise, I'll try to fix it myself in the near future.
Thanks!
Fixed in v0.0.9 on PyPI.
Sidenote: Related to #10