How to get the sequential id for the experiment

Hi I am trying to name the experiment as per my project as well as a sequential id, for example my Project name is Semantic Segmentation and I have 3 runs, I want to name them something like SEM-1,SEM-2 and so on,
Essentially I need to log the new experiment by getting the previous experiment id and incrementing it by 1, if it is the first experiment then just start by first three letters of project and then append 1 and so on

Hi @hafizprecisionai , thank you for writing in. wandb.init() allows you to assign unique names to your experiments via the name argument. You can additionally assign unique run ids to an experiment run using the id argument. Hope this helps and please let me know if you have any questions.

1 Like

Hi @hafizprecisionai , thank you for writing in. wandb.init() allows you to assign unique names to your experiments via the name argument. You can additionally assign unique run ids to an experiment run using the id argument. Hope this helps and please let me know if you have any questions.

[Discourse post]

Hi @mohammadbakir , Yes I know that, but what I want is to increment the ids based on what is already logged in wandb

Hi @hafizprecisionai , thanks for clarifying. One way to accomplish this is to use our api. You could for example verify the current run ids / names of runs to a project and implement your own logic from there for incrementing.

api = wandb.Api()
entity, project = "<entity>", "<project>"  # set to your entity and project 
runs = api.runs(entity + "/" + project)
.....
#Check Run Ids/names `(run.id/run.name)` of fetched runs and increment accordingly

Hi @hafizprecisionai , 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!

@mohammadbakir Thank you Mohammad Bakir, I was able to solve with the given instruction. Really appreciate your help in this regard

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