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.

Problems loggin data with sweep

See original GitHub issue

Hello I’m working with wandb in the optimization of a network and since I updated to the last version I found some problems with the sweep that I didn’t find before. My code runs like this:

for train_index, test_index in kf.split(dataset_train):
     run = wandb.init(project="3d-deep", group=group_id, job_type="training", reinit=True)
     wandb.config.update(args)
     F1_result = train(args, model, run, optimizer, dataloader_train, dataloader_val) #Train loop with run.log items
     F1_record.append(F1_result)
     run.finish()

run = wandb.init(project="3d-deep", group=group_id, job_type="eval")
F1_record = np.array(F1_record)
F1_mean = np.mean(F1_record)
F1_max = np.max(F1_record)
run.log({"Val/F1_mean": F1_mean,
              "Val/F1_max": F1_max}, step=0)

The thing is that if I launch the code without a sweep works fine and all the folds are logged as a different run but grouped by, and the F1_max and F1_mean are logged too. However, if I create a sweep from the web console of my project the runs don’t group each other and overwrite the previous ones in the graph and the F1_mean and F1_max values don’t appear anywhere. That didn’t happen in previous versions where the method to use was wandb.join() instead of run.finish() . Also, as a minor problem, the steps in my graphs are not rounded numbers despite the step that I’m passing to the log function is the epoch, that is an integer.

Please, can you help me with this?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
vanpeltcommented, Jan 25, 2022

@maltemosbach ahh, I see. When running in a sweep the agent sets WANDB_RUN_ID which is causing each of the init methods to log to the same run. We should handle this better in the SDK, but today you should be able to add the following after your first wandb.finish() call to make the eval run appear as a separate run:

if os.environ.get("WANDB_RUN_ID"):
    del os.environ['WANDB_RUN_ID']
1reaction
vanpeltcommented, Oct 15, 2021

@pkuderov the next release of the library should have functionality to make the use case of launching multiple runs from a single sweep run much easier. Ping us here next week and we can get you instructions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problems loggin data with sweep #1529 - wandb ... - GitHub
The thing is that if I launch the code without a sweep works fine and all the folds are logged as a different...
Read more >
Sweeping SEPM log data from the database manually.
You can sweep log data from the database manually by following this procedure: Preliminary Steps: Increase the Site Properties Log Settings ...
Read more >
FAQ - Documentation - Weights & Biases - Wandb
To enable code logging for sweeps, simply add wandb. log_code() after you have initialized your W&B Run. This is necessary even when you...
Read more >
error combining parameter sweep results - Feko - Altair Products
I'm having a problem with the parameter sweep macro in Cadfeko/Postfeko. The model creation and solver portion of the macro generates the ...
Read more >
parametric sweep (old issue, new problem) - COMSOL
I know I can do it exporting the data, but this will be quite time-consuming and I would expect such functionality to be...
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