# How to properly integrate Wandb and RayTune?

**URL:** <https://discuss.ray.io/t/how-to-properly-integrate-wandb-and-raytune/3206>\
**Category:** Ray Tune\
**Created:** [August 11, 2021, 6:51am UTC](https://discuss.ray.io/t/how-to-properly-integrate-wandb-and-raytune/3206 "2021-08-11T06:51:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luca\_Guarro](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/luca_guarro/32/1085_2.png) [@Luca\_Guarro](https://discuss.ray.io/u/Luca_Guarro)\
**Post date:** [August 11, 2021, 6:51am UTC](https://discuss.ray.io/t/how-to-properly-integrate-wandb-and-raytune/3206/1 "2021-08-11T06:51:14Z")

</div>

I have followed [the docs](https://docs.ray.io/en/master/tune/tutorials/tune-wandb.html) to integrate wandb with tune yet the wandb side of things don’t even seem to initialize. On my wandb page, there are no reported runs either.

I am using the WandbLoggerCallback which says that metrics reported to Tune are automatically reported to the wandb API.

I configure my tune run with the wandb callback like so:

```auto
result = tune.run(
    partial(mm_train_fun1, checkpoint_dir='/tmp/MMModels'),
    config = tune_config,
    resources_per_trial={'gpu': 1},
    metric = 'eval_loss',
    mode = 'min',
    num_samples = num_samples,
    scheduler = scheduler,

    callbacks=[WandbLoggerCallback(
        project="MultiModalClassifier",
        group='raytune_hpsearch',
        api_key=config['WandB']['api_key'],
        log_config=True
    )])

```

In my training, I then use tune.report to report my results:

`tune.report(loss = loss.item(), epoch = epoch + batch_idx / len(train_dataloader), eval_loss=(val_loss / val_steps), eval_f1=s_f1, eval_precision=s_precision, eval_recall=s_recall)`

Why isn’t any information being logged to my wandb profile?

---

<div class="post-metadata">

**Author:** ![amogkam](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/amogkam/32/17_2.png) [@amogkam](https://discuss.ray.io/u/amogkam)\
**Post date:** [August 11, 2021, 7:38pm UTC](https://discuss.ray.io/t/how-to-properly-integrate-wandb-and-raytune/3206/2 "2021-08-11T19:38:50Z")

</div>

Hey @Luca_Guarro can you share what your stdout looks like? Thanks!

---

<div class="post-metadata">

**Author:** ![Luca\_Guarro](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/luca_guarro/32/1085_2.png) [@Luca\_Guarro](https://discuss.ray.io/u/Luca_Guarro)\
**Post date:** [August 11, 2021, 8:07pm UTC](https://discuss.ray.io/t/how-to-properly-integrate-wandb-and-raytune/3206/3 "2021-08-11T20:07:55Z")

</div>

Hey @amogkam, here is a screenshot:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/ray/original/2X/7/7cf5a0513935cc1014c7bbcf74a2d05bf52719b0.png)

The hyperparameter search seems to run fine but there is no information about wandb and the results reported to stdout do not get reported to wandb either. So it is as if, it glosses over the wandbcallback altogether.

---

<div class="post-metadata">

**Author:** ![Luca\_Guarro](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/luca_guarro/32/1085_2.png) [@Luca\_Guarro](https://discuss.ray.io/u/Luca_Guarro)\
**Post date:** [August 11, 2021, 8:08pm UTC](https://discuss.ray.io/t/how-to-properly-integrate-wandb-and-raytune/3206/4 "2021-08-11T20:08:31Z")

</div>

I am familiar with using wandb via the huggingface api, and have gotten stdout messages about wandb in those cases like so:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/ray/original/2X/1/192038ccc4d74ba32ec19c4a4032b4e26909a0fb.png)

So I would expect something similar for when I get it working properly.
