Problems loggin data with sweep
See original GitHub issueHello 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:
- Created 3 years ago
- Reactions:1
- Comments:13 (5 by maintainers)
Top GitHub Comments
@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:@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.