ArneBinder / pytorch-ie-hydra-template-1

PyTorch-IE Hydra Template
8 stars 1 forks source link

wandb UsageError running training on the cluster #174

Closed kai-car closed 2 months ago

kai-car commented 2 months ago

I tried running the training script for the drugprot experiment on the cluster (using Pegasus Bridle wrapper) with the following command. The logger of the drugprot.yaml is configured with - override /logger: wandb:

(exp-env) user@login1:/netscratch/user/drugprot-exp$ bash /home/$USER/projects/pegasus-bridle/wrapper.sh python src/train.py experiment=drugprot


I received the following error message, despite being logged into wandb through the console (command: wandb login):

wandb.errors.UsageError: api_key not configured (no-tty). call wandb.login(key=[your_api_key])


I solved this through inserting the wandb.login() call in the the train.py script:

if __name__ == "__main__":
    wandb.login(key='YOUR_API_KEY')
    utils.replace_sys_args_with_values_from_files()
    utils.prepare_omegaconf()
    main()

Also see issue #17 of Pegasus Bridle repository.