在使用 Yolov5 进行自定义模型训练时,建模框架似乎觉得我应该使用 Weights and Biases (
wandb
)、ClearML、TensorBoard 和其他我不需要也不想使用的外部 MLOps 应用程序查看有关的多余消息。有什么办法让它忽略这些并工作吗?
以前我可以成功地进行训练,但这只是一个烦恼。现在由于某种原因它实际上阻止了训练的运行:
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: (30 second timeout)
wandb: W&B disabled due to login timeout.
train: weights=yolov5s.pt, cfg=, data=../export-2022-09-19T17_46_47.492Z/export-2022-09-19T17_46_47.492Z.yaml, hyp=data/hyps/hyp.scratch-low.yaml, epochs=5, batch_size=16, imgsz=640, rect=False, resume=False, nosave=False, noval=False, noautoanchor=False, noplots=False, evolve=None, bucket=, cache=None, image_weights=False, device=, multi_scale=False, single_cls=False, optimizer=SGD, sync_bn=False, workers=8, project=runs/train, name=exp, exist_ok=False, quad=False, cos_lr=False, label_smoothing=0.0, patience=100, freeze=[0], save_period=-1, seed=0, local_rank=-1, entity=None, upload_dataset=False, bbox_interval=-1, artifact_alias=latest
remote: Enumerating objects: 78, done.
remote: Counting objects: 100% (78/78), done.
remote: Compressing objects: 100% (44/44), done.
remote: Total 78 (delta 50), reused 49 (delta 34), pack-reused 0
Unpacking objects: 100% (78/78), done.
From https://github.com/ultralytics/yolov5
0b724c5..e233c03 master -> origin/master
3cb5c9d..0706315 exp/scaleFill -> origin/exp/scaleFill
* [new branch] exp8/shortcut_gain -> origin/exp8/shortcut_gain
* [new branch] fix/tf -> origin/fix/tf
68a201a..b815294 update/cls-album -> origin/update/cls-album
github: ⚠️ YOLOv5 is out of date by 5 commits. Use `git pull` or `git clone https://github.com/ultralytics/yolov5` to update.
YOLOv5 🚀 v6.2-141-g0b724c5 Python-3.10.6 torch-1.12.1 CPU
hyperparameters: lr0=0.01, lrf=0.01, 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.5, cls_pw=1.0, obj=1.0, 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.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.0, copy_paste=0.0
Weights & Biases: run 'pip install wandb' to automatically track and visualize YOLOv5 🚀 runs in Weights & Biases
Comet: run 'pip install comet_ml' to automatically track and visualize YOLOv5 🚀 runs in Comet
TensorBoard: Start with 'tensorboard --logdir runs/train', view at http://localhost:6006/
Traceback (most recent call last):
File "/Users/some.person/Documents/mypath/yolov5/train.py", line 630, in <module>
main(opt)
File "/Users/some.person/Documents/mypath/yolov5/train.py", line 526, in main
train(opt.hyp, opt, device, callbacks)
File "/Users/some.person/Documents/mypath/yolov5/train.py", line 94, in train
loggers = Loggers(save_dir, weights, opt, hyp, LOGGER) # loggers instance
File "/Users/some.person/Documents/mypath/yolov5/utils/loggers/__init__.py", line 121, in __init__
self.clearml = ClearmlLogger(self.opt, self.hyp)
File "/Users/some.person/Documents/mypath/yolov5/utils/loggers/clearml/clearml_utils.py", line 87, in __init__
self.task = Task.init(
File "/usr/local/lib/python3.10/site-packages/clearml/task.py", line 583, in init
task = cls._create_dev_task(
File "/usr/local/lib/python3.10/site-packages/clearml/task.py", line 3035, in _create_dev_task
task = cls(
File "/usr/local/lib/python3.10/site-packages/clearml/task.py", line 183, in __init__
super(Task, self).__init__(**kwargs)
File "/usr/local/lib/python3.10/site-packages/clearml/backend_interface/task/task.py", line 155, in __init__
super(Task, self).__init__(id=task_id, session=session, log=log)
File "/usr/local/lib/python3.10/site-packages/clearml/backend_interface/base.py", line 145, in __init__
super(IdObjectBase, self).__init__(session, log, **kwargs)
File "/usr/local/lib/python3.10/site-packages/clearml/backend_interface/base.py", line 39, in __init__
self._session = session or self._get_default_session()
File "/usr/local/lib/python3.10/site-packages/clearml/backend_interface/base.py", line 115, in _get_default_session
InterfaceBase._default_session = Session(
File "/usr/local/lib/python3.10/site-packages/clearml/backend_api/session/session.py", line 178, in __init__
raise ValueError(
ValueError: ClearML configuration could not be found (missing `~/clearml.conf` or Environment CLEARML_API_HOST)
To get started with ClearML: setup your own `clearml-server`, or create a free account at https://app.clear.ml
调用这些错误的 Jupyter Lab 笔记本单元格值:
!python3 train.py --img 640 --batch 16 --epochs 5 --data '../myfolder/export-2022-09.yaml' --weights yolov5s.pt
通过卸载他们的 pip 包:
pip3 uninstall clearml
pip3 uninstall wandb
否则它将尝试登录 ClearML、Weights 和 Biases 等。请勿卸载
tensorboard
。
对于那些不想卸载其他软件包的人:
from ultralytics import settings
settings.update({"wandb": False})
您还可以为此更改环境变量。 在 python 中执行此操作:
import os
os.environ['WANDB_MODE'] = 'disabled'
我认为其他记录器(clearml、tensorboard)也有类似的东西,但我没有那些,所以没有测试它。