Sweep login problem - Sweep not found

So I’ve set up a new sweep via the browser, setup worked successfully:
Capture d’écran de 2024-02-22 18-34-21

However, there seems to be a glitch in the sweep setup or something, because, even when I run wandb login --relogin immediately beforehand, the agent launch command prompts me for the same API key again twice, then cannot find the sweep…

$ wandb login --relogin <(my API key)>
>>>  wandb: Appending key for api.wandb.ai to your netrc file: /home/mrim/manniona/.netrc
$ wandb agent aidanm/sos-diagcode-sk/zqicwekz
>>>  wandb: Login to W&B to use the sweep agent feature
>>>  wandb: Logging into wandb.ai. (Learn how to deploy a W&B server locally: https://wandb.me/wandb-server)
>>>  wandb: You can find your API key in your browser here: https://wandb.ai/authorize
>>>  wandb: Paste an API key from your profile and hit enter, or press ctrl+c to quit:
>>>  wandb: Appending key for api.wandb.ai to your netrc file: /home/mrim/manniona/.netrc
>>>  wandb: Starting wandb agent 🕵️
>>>  wandb: (1) Create a W&B account
>>>  wandb: (2) Use an existing W&B account
>>>  wandb: (3) Don't visualize my results
>>>  wandb: Enter your choice: 2
>>>  wandb: You chose 'Use an existing W&B account'
>>>  wandb: Logging into wandb.ai. (Learn how to deploy a W&B server locally: https://wandb.me/wandb-server)
>>>  wandb: You can find your API key in your browser here: https://wandb.ai/authorize
>>>  wandb: Paste an API key from your profile and hit enter, or press ctrl+c to quit:
>>>  wandb: Appending key for api.wandb.ai to your netrc file: /home/mrim/manniona/.netrc
>>>  wandb: ERROR Find detailed error logs at: /home/mrim/manniona/wandb/debug-cli.manniona.log
Error: Sweep aidanm/sos-diagcode-sk/zqicwekz not found

Ordinary runs for the same project work fine, although since yesterday the multiple-choice input thing has been triggered every time I run wandb.init

Using wandb 0.16.3 on Debian

So I have two questions:

  1. Is there a way to get the sweep agent feature to see that I’ve already logged in?
  2. How can I disable the multiple-choice input part? I found a workaround that involves editing the source code so that I can pass my API key to the wandb_login._login function, but surely it can’t be necessary to manually select one of those options every time??!

Hi @aidanm , I attempted to reproduce this reported behavior but have been unsuccessful.

  • Within your script are you call wandb.login() anywhere?
  • Could you provide a toy example of your sweep file to help us in reproduction. Thanks

Hi, thanks for responding, here’s a toy example of the yaml file I used:

project: sos-diagcode-sk
entity: aidanm
program: /aidan/home/experiments/classification.py
name: gridsearch
command:
  - /aidan/home/miniconda3/envs/xp/bin/python3
  - ${program}
  - ${args}
  - --stratify
  - --no_warn
  - --multilabel
  - --sample
method: grid
metric:
  name: weighted_f1
parameters:
  clf_type:
    value: lgbm
  input_fp:
    value: /aidan/home/input-directory/tabula.csv
  wb:
    value: <my API key>
  num_threads:
    value: 16
  min_label_count:
    value: 30
  cv:
    value: 1
  holdout:
    value: 0.1
  nrows:
    value: 100000
  reg_alpha:
    value: 0.275
  reg_lambda:
    value: 0.3
  learning_rate:
    values:
      - 0.1
      - 0.125
      - 0.15
      - 0.175
      - 0.2
  n_estimators:
    values:
      - 100
      - 200
      - 300
  num_leaves:
    values:
      - 64
      - 128
      - 256
description: Gridsearch

The script in question runs the following:

try:
    wandb.login(key=wandb_key, relogin=True)
except Exception as exc:
    logger.error("Failed to connect to W&B\n%s", str(exc))

where the variable wandb_key is given by the input argument wb of the script

@aidanm thank you for providing your files. I was still unable to reproduce the behavior reported. Could your try the following

  • remove your netrc rm ~/.netrc file to delete local wandb api key
  • run your script and remove relogin from wandb.login
  • run your script with calling wandb login --relogin

Is there a change in behavior

If not there may be an environment component that could be contributing. Have you set wandb credentials else where whether it be in settings file or .env file?

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