WongKinYiu / yolov7

Implementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
GNU General Public License v3.0
13.15k stars 4.16k forks source link

raise 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]) #1171

Open eagl69 opened 1 year ago

eagl69 commented 1 year ago

C:\Users\eagl6\AppData\Local\Programs\Python\Python310\python.exe C:\Python\PhotoSkaning\Dataset\yolov7-custom\train.py YOLOR 970ae6e torch 1.13.0+cpu CPU

Namespace(weights='yolo7.pt', cfg='cfg/training/yolov7-custom.yaml', data='data/custom_data.yaml', hyp='data/hyp.scratch.p5.yaml', epochs=30, batch_size=4, img_size=[640, 640], rect=False, resume=False, nosave=False, notest=False, noautoanchor=False, evolve=False, bucket='', cache_images=False, image_weights=False, device='cpu', multi_scale=False, single_cls=False, adam=False, sync_bn=False, local_rank=-1, workers=1, project='runs/train', entity=None, name='exp', exist_ok=False, quad=False, linear_lr=False, label_smoothing=0.0, upload_dataset=False, bbox_interval=-1, save_period=-1, artifact_alias='latest', freeze=[0], v5_metric=False, world_size=1, global_rank=-1, save_dir='runs\train\exp34', total_batch_size=4) tensorboard: Start with 'tensorboard --logdir runs/train', view at http://localhost:6006/ 2022-11-25 19:16:30.764608: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found 2022-11-25 19:16:30.764725: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. hyperparameters: lr0=0.01, lrf=0.1, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=0.05, cls=0.3, cls_pw=1.0, obj=0.7, obj_pw=1.0, iou_t=0.2, anchor_t=4.0, fl_gamma=0.0, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.2, scale=0.9, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.15, copy_paste=0.0, paste_in=0.15, loss_ota=1 wandb: ERROR api_key not configured (no-tty). call wandb.login(key=[your_api_key]) Traceback (most recent call last): File "C:\Python\PhotoSkaning\Dataset\yolov7-custom\train.py", line 616, in train(hyp, opt, device, tb_writer) File "C:\Python\PhotoSkaning\Dataset\yolov7-custom\train.py", line 72, in train wandb_logger = WandbLogger(opt, Path(opt.save_dir).stem, run_id, data_dict) File "C:\Python\PhotoSkaning\Dataset\yolov7-custom\utils\wandb_logging\wandb_utils.py", line 95, in init self.wandb_run = wandb.init(config=opt, File "C:\Users\eagl6\AppData\Local\Programs\Python\Python310\lib\site-packages\wandb\sdk\wandb_init.py", line 1075, in init wi.setup(kwargs) File "C:\Users\eagl6\AppData\Local\Programs\Python\Python310\lib\site-packages\wandb\sdk\wandb_init.py", line 274, in setup wandb_login._login( File "C:\Users\eagl6\AppData\Local\Programs\Python\Python310\lib\site-packages\wandb\sdk\wandb_login.py", line 298, in _login wlogin.prompt_api_key() File "C:\Users\eagl6\AppData\Local\Programs\Python\Python310\lib\site-packages\wandb\sdk\wandb_login.py", line 228, in prompt_api_key raise 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])

Process finished with exit code 1

eagl69 commented 1 year ago

Explain how to keep the key on the local computer?

Andrewhsin commented 1 year ago

在終端機上面輸入" wandb offline "即可跳過此報錯

eagl69 commented 1 year ago

I can't figure out how to do this in Pycharm?

PS C:\Python\Skaning_Yolov7> wandb offline wandb : Имя "wandb" не распознано как имя командлета, функции, файла сценария или выполняемой программы. Проверьте правильность написания имени, а также наличие и правильность пути, после чего пов торите попытку. строка:1 знак:1

Andrewhsin commented 1 year ago

我不知道如何在 Pycharm 中执行此操作?

PS C:\Python\Skaning_Yolov7> wandb offline wandb : Имя "wandb" не распознано как имя командлета, функции, файла сценария или выполняпрамой. Проверьте правильность написания имени,а также наличие и правильность пути,после чего пов торите попытктк。 строка:1 знак:1

  • wandb离线
  • + CategoryInfo          : ObjectNotFound: (wandb:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

There will be a "terminal" symbol in the lower part of the pycharm interface. After clicking on it, the terminal will be displayed, and you can directly enter "wandb offline".

eagl69 commented 1 year ago

That's what I did:

PS C:\Python\Photo_Trening_YOLOV7\venv\Scripts> .\wandb offline W&B offline. Running your script from this directory will only write metadata locally. Use wandb disabled to completely turn off W&B. PS C:\Python\Photo_Trening_YOLOV7\venv\Scripts>

But the error remains:

File "C:\Python\Photo_Trening_YOLOV7\venv\lib\site-packages\wandb\sdk\wandb_login.py", line 228, in prompt_api_key raise 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]) python-BaseException

Andrewhsin commented 1 year ago

那就是我所做的:

PS C:\Python\Photo_Trening_YOLOV7\venv\Scripts> .\wandb 离线 W&B 离线。从此目录运行脚本只会在本地写入元数据。使用 wandb disabled 完全关闭 W&B。 PS C:\Python\Photo_Trening_YOLOV7\venv\Scripts>

但错误仍然存​​在:

文件“C:\Python\Photo_Trening_YOLOV7\venv\lib\site-packages\wandb\sdk\wandb_login.py”,第 228 行,在 prompt_api_key raise UsageError(“api_key not configured (no-tty).call” + directive) wandb .errors.UsageError:未配置 api_key(无 tty)。调用 wandb.login(key=[your_api_key]) python-BaseException

According to your current code, the reason is that your folder guide should be to enter the command in "C:\Python\Photo_Trening_YOLOV7" or "C:\Python\Photo_Trening_YOLOV7\venv" and lead to "C:\Python \Photo_Trening_YOLOV7\venv\Scripts" may cause an error.

This method currently uses this kind of error reporting, you can try again.

eagl69 commented 1 year ago

Running the command .\wandb offline from the root folder results in an error. PS C:\Python\Photo_Trening_YOLOV7> .\wandb offline .\and : Name ".\wandb" is not recognized as the name of a cmdlet, function, script file, or executable program. Check the spelling of the name, as well as the presence and correctness of the path, and then try again.