How do I set the wandb alert programatically for my current run?

I want to detect if it fails. I’ve spent some time googling and chatting with chat bots. None of the options worked e.g.,

    debug: bool = mode == 'dryrun'
    run = wandb.init(mode=mode, project="beyond-scale", name=run_name, save_code=True)
    wandb.config.update({"num_batches": num_batches, "path": path, "name": name, "today": today, 'probabilities': probabilities, 'batch_size': batch_size, 'debug': debug, 'data_mixture_name': data_mixture_name})
    run.notify_on_failure()

failed.

What is right way to do this?

not all options worked

run.notify_on_crash()

run.notify_on_exit()

run.notify_on_failure()

run.notify_on_heartbeat()

pydevd warning: Computing repr of summary (Summary) was slow (took 60.01s) Customize report timeout by setting the PYDEVD_WARN_SLOW_RESOLVE_TIMEOUT environment variable to a higher timeout (default is: 0.5s)

Traceback (most recent call last): File "<string>", line 1, in <module> AttributeError: 'Run' object has no attribute 'notify_on_exist'

Traceback (most recent call last): File "<string>", line 1, in <module> AttributeError: 'Run' object has no attribute 'notify_on_exist'

Traceback (most recent call last): File "<string>", line 1, in <module> AttributeError: 'Run' object has no attribute 'notify_on_crash'

Traceback (most recent call last): File "<string>", line 1, in <module> AttributeError: 'Run' object has no attribute 'notify_on_exit'

Traceback (most recent call last): File "<string>", line 1, in <module> AttributeError: 'Run' object has no attribute 'notify_on_failure'

Traceback (most recent call last): File "<string>", line 1, in <module> AttributeError: 'Run' object has no attribute 'notify_on_heartbeat'

run.notify_on_abort()

Traceback (most recent call last): File "<string>", line 1, in <module> AttributeError: 'Run' object has no attribute 'notify_on_abort'

Hello @brando!

Are you looking to use wandb.alert()(docs)?

You can set it with something like this:

text = f"Accuracy {acc} is below acceptable threshold {thresh}"

wandb.alert(
    title="Low accuracy", 
    text=text
)

Hi there, I wanted to follow up on this request. Please let us know if we can be of further assistance or if your issue has been resolved.

Hi Brando,

Since we have not heard back from you we are going to close this request. If you would like to re-open the conversation, please let us know!

Warmly,
Artsiom

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.