Skip to content
Advertisement

Hyperparameter tunning with wandb – CommError: Sweep user not valid when trying to initial the sweep

I’mt rying to use wandb for hyperparameter tunning as described in this notebook (but using my dataframe and trying to do it on random forest regressor instead).

I’m trying to initial the sweep but I get the error:

sweep_configuration = {
    "name": "test-project",
    "method": "random",
    "entity":"my_name"ת
    "metric": {
        "name": "loss",
        "goal": "minimize"
    }
    
}

parameters_dict = {
    'n_estimators': {
        'values': [100,200,300]
        },
    'max_depth': {
        'values': [4,7,10,14]
        },
    'min_samples_split': {
          'values': [2,4,8]
        },
    
    'min_samples_leaf': {
          'values': [2,4,8]
        },
    
    
    'max_features': {
          'values': [1,7,10]
        },

    }

sweep_configuration['parameters'] = parameters_dict

sweep_id = wandb.sweep(sweep_configuration)


400 response executing GraphQL. {“errors”:[{“message”:”Sweep user not valid”,”path”:[“upsertSweep”]}],”data”:{“upsertSweep”:null}} wandb: ERROR Error while calling W&B API: Sweep user not valid (<Response [400]>)
CommError: Sweep user not valid

My end goal : to inital the sweep

Advertisement

Answer

Two things to try:

  • Like in the notebook, you should pass project="your-project-name" like wandb.sweep(sweep_configuration, project="your-project-name")

  • Have you logged in to W&B (using wandb.login())?

Finally, once you’ve successfully created the sweep, you should pass the sweep_id and your function (here train) like: wandb.agent(sweep_id, train, count=5)

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement