question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it possible to have two runs concurrently in one script?

See original GitHub issue

Description

I want to have two runs from two projects in one script. Is this supported, or do you have any viable alternatives for this?

This is different from this commonly asked question in that I also want another run outside the loop.

What I Did

meta_run = wandb.init(project="meta")

for ... # Meta loop
    individual_run= wandb.init(project="individual")
    for ... # Training loop
        individual_run.log(...)
    individual_run.join()
    meta_run.log()

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
seungjaeryanleecommented, May 28, 2020

@cvphelps, like this?

import random
import wandb

wandb.init(project="delete-this")

for n_units in [1, 2, 3]:
    for epoch_i in [1, 2, 3, 4, 5]:
        wandb.log({"train/loss": epoch_i * 100 - random.randint(-10, 10)})
        wandb.log({"valid/loss": epoch_i * 100 - random.randint(-20, 20)})
    
    wandb.log({
        "n_units": n_units,
        "test/loss": n_units * 10 - random.randint(-5, 5),
    })

This solution does not work for me since I can’t plot the individual runs separately. These are the plots I get:

image

Is there a way to plot each individual run separately?

By the way, thank you for your swift responses! You are awesome 😄

2reactions
vanpeltcommented, May 28, 2020

@seungjaeryanlee if your n_units actually correspond to different models you can start 3 different runs:

import random
import wandb

for n_units in [1, 2, 3]:
    wandb.init(project="delete-this", config={"n_units": n_units}, reinit=True)
    for epoch_i in [1, 2, 3, 4, 5]:
        wandb.log({"train/loss": epoch_i * 100 - random.randint(-10, 10)}, step=epoch_i)
        wandb.log({"valid/loss": epoch_i * 100 - random.randint(-20, 20)}, step=epoch_i)
    wandb.log({
        "test/loss": n_units * 10 - random.randint(-5, 5),
    })
Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it possible to have two runs concurrently in one script? #1063
It's not currently possible. Only one run can be tracked concurrently in a single process. Is it possible to run the meta loop...
Read more >
How can I run multiple Bash scripts simultaneously in a ...
There is a way to run the same command simultaneously in multiple panes. Here is an example. I want to run echo "Fruit...
Read more >
python - Is there a way to run multiple bash scripts with one ...
Show activity on this post. Only one process in shell can run in foreground mode. So the command gets executed only when the...
Read more >
Can you run multiple python scripts at once? - Quora
Yes, you can run multiple python scripts at once. In python, we use multi-threading to run multiple works simultaneously. Here you will find...
Read more >
Run multiple script at same time - Claris Community
You can't run multiple scripts on the client at the same time. You can run one script locally and the other one on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found