# Hparam tensorboard logging with pytorch?

**URL:** https://discuss.ray.io/t/hparam-tensorboard-logging-with-pytorch/213
**Category:** Ray Tune
**Created:** [December 11, 2020, 11:44pm UTC](https://discuss.ray.io/t/hparam-tensorboard-logging-with-pytorch/213 "2020-12-11T23:44:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mm04926412](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/mm04926412/32/117_2.png) [@mm04926412](https://discuss.ray.io/u/mm04926412)
#### Post date: [December 11, 2020, 11:44pm UTC](https://discuss.ray.io/t/hparam-tensorboard-logging-with-pytorch/213/1 "2020-12-11T23:44:45Z")

</div>

On the tensorboard page it states

“If using TF2, Tune also automatically generates TensorBoard HParams output, as shown below:”

Is it possible to get this to work when using pytorch (specifically pytorch lightning), I’ve tried self.save\_hyperparameters() and I’ve managed to save the hparams but I’ve not found a way to pass metrics properly. I’ve tried the pytorch lightning function

self.logger.experiment.add\_hparams(self.hparams\_dict, metrics\_dict)

but this doesn’t work inside callbacks so its become unclear how to pass the metrics properly?

---

<div class="post-metadata">

### Author: ![import-antigravity](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/import-antigravity/32/562_2.png) [@import-antigravity](https://discuss.ray.io/u/import-antigravity)
#### Post date: [March 2, 2021, 3:50am UTC](https://discuss.ray.io/t/hparam-tensorboard-logging-with-pytorch/213/2 "2021-03-02T03:50:53Z")

</div>

I’m wondering how to do this as well. From every indication in the docs it seems like it should happen automatically, at least as far as for the metrics you have Ray Tune observe in the `TuneReportCallback` instance. Any help would be greatly appreciated, I’m not sure if I can really use Ray Tune until this is resolved

---

<div class="post-metadata">

### Author: ![import-antigravity](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/import-antigravity/32/562_2.png) [@import-antigravity](https://discuss.ray.io/u/import-antigravity)
#### Post date: [March 2, 2021, 4:32pm UTC](https://discuss.ray.io/t/hparam-tensorboard-logging-with-pytorch/213/3 "2021-03-02T16:32:00Z")

</div>

Hi,

I think I found a bug in `TBXLoggerCallback` which is causing this to happen. Please see the issue I opened:

> <https://github.com/ray-project/ray/issues/14437>
>
> What is the problem?
> I'm trying to use some very simple code to get rolling with Tune and Pytorch Lightning. I've been...
