wandb: ERROR api_key not configured (no-tty). call wandb.login(key=[your_api_key]) Traceback (most recent call last):
背景
使用yolov8训练时 在pycharm中出现wandb账号未注册错误
Transferred 355/355 items from pretrained weights
TensorBoard: Start with 'tensorboard --logdir runs\detect\train17', view at http://localhost:6006/
wandb: ERROR api_key not configured (no-tty). call wandb.login(key=[your_api_key])
Traceback (most recent call last):File "E:/new work space/python/ultralytics-main/train.py", line 10, in <module>results = model.train(data='coco128.yaml', epochs=5, imgsz=640,batch=-1,workers=2)File "E:\new work space\python\ultralytics-main\ultralytics\engine\model.py", line 673, in trainself.trainer.train()File "E:\new work space\python\ultralytics-main\ultralytics\engine\trainer.py", line 199, in trainself._do_train(world_size)File "E:\new work space\python\ultralytics-main\ultralytics\engine\trainer.py", line 313, in _do_trainself._setup_train(world_size)File "E:\new work space\python\ultralytics-main\ultralytics\engine\trainer.py", line 226, in _setup_trainself.run_callbacks("on_pretrain_routine_start")File "E:\new work space\python\ultralytics-main\ultralytics\engine\trainer.py", line 162, in run_callbackscallback(self)File "E:\new work space\python\ultralytics-main\ultralytics\utils\callbacks\wb.py", line 112, in on_pretrain_routine_startwb.run or wb.init(project=trainer.args.project or "YOLOv8", name=trainer.args.name, config=vars(trainer.args))File "D:\Program Files\Python\Python38\lib\site-packages\wandb\sdk\wandb_init.py", line 1200, in initraise eFile "D:\Program Files\Python\Python38\lib\site-packages\wandb\sdk\wandb_init.py", line 1177, in initwi.setup(kwargs)File "D:\Program Files\Python\Python38\lib\site-packages\wandb\sdk\wandb_init.py", line 301, in setupwandb_login._login(File "D:\Program Files\Python\Python38\lib\site-packages\wandb\sdk\wandb_login.py", line 334, in _loginwlogin.prompt_api_key()File "D:\Program Files\Python\Python38\lib\site-packages\wandb\sdk\wandb_login.py", line 263, in prompt_api_keyraise UsageError("api_key not configured (no-tty). call " + directive)
wandb.errors.UsageError: api_key not configured (no-tty). call wandb.login(key=[your_api_key])进程已结束,退出代码1
解决方法
登录wandb官网注册并登录后获取一个鉴权码
第一次登录进行注册
随便填写个人信息 然后提交
复制api_key
在终端cmd中输入
wandb login b215bd93f9