# How to use WandB mixin in custom call backs

**URL:** <https://discuss.ray.io/t/how-to-use-wandb-mixin-in-custom-call-backs/3397>\
**Category:** RLlib\
**Created:** [August 30, 2021, 11:35pm UTC](https://discuss.ray.io/t/how-to-use-wandb-mixin-in-custom-call-backs/3397 "2021-08-30T23:35:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Selim\_Amrouni](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/selim_amrouni/32/1458_2.png) [@Selim\_Amrouni](https://discuss.ray.io/u/Selim_Amrouni)\
**Post date:** [August 30, 2021, 11:35pm UTC](https://discuss.ray.io/t/how-to-use-wandb-mixin-in-custom-call-backs/3397/1 "2021-08-30T23:35:46Z")

</div>

Hello,

I would like to use WandB mixin in Custom Callbacks.  
My goal would be to log and send histograms for example.

Please do you have code examples on how to do that?

I keep getting this error.

```auto
  File "/home/ubuntu/.local/lib/python3.7/site-packages/ray/tune/integration/wandb.py", line 521, in __init__
    "Wandb mixin specified but no configuration has been passed. "
ValueError: Wandb mixin specified but no configuration has been passed. Make sure to include a `wandb` key in your `config` dict containing at least a `project` specification.

```

when using the mixin decorator around the `on_episode_end` method in the callbacks.

Thank you ! 🙂

---

<div class="post-metadata">

**Author:** ![sven1977](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sven1977/32/53_2.png) [@sven1977](https://discuss.ray.io/u/sven1977)\
**Post date:** [August 31, 2021, 7:09am UTC](https://discuss.ray.io/t/how-to-use-wandb-mixin-in-custom-call-backs/3397/2 "2021-08-31T07:09:50Z")

</div>

Hey @Selim_Amrouni , thanks for the question. Could someone from the Ray Tune team help here? @kai @rliaw ? Thx! 🙂

---

<div class="post-metadata">

**Author:** ![kai](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/kai/32/3380_2.png) [@kai](https://discuss.ray.io/u/kai)\
**Post date:** [August 31, 2021, 9:03am UTC](https://discuss.ray.io/t/how-to-use-wandb-mixin-in-custom-call-backs/3397/3 "2021-08-31T09:03:06Z")

</div>

Hi @Selim_Amrouni, the mixin can only be used for trainables, not for callbacks.

Within the trainable you can then use the regular wandb API to communicate with Weights & Biases.

You will also need to pass a configuration dict to tune.

See the documentation here: [External library integrations (tune.integration) — Ray v1.6.0](https://docs.ray.io/en/latest/tune/api_docs/integration.html#weights-and-biases-tune-integration-wandb)

---

<div class="post-metadata">

**Author:** ![Selim\_Amrouni](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/selim_amrouni/32/1458_2.png) [@Selim\_Amrouni](https://discuss.ray.io/u/Selim_Amrouni)\
**Post date:** [August 31, 2021, 2:09pm UTC](https://discuss.ray.io/t/how-to-use-wandb-mixin-in-custom-call-backs/3397/4 "2021-08-31T14:09:15Z")

</div>

Hello Kai,

Thank you for your answer. So if I want to retrieve data computed in callbacks, what would you advise to do?
