Start Multi-OS CI (#172)

single_channel
Glenn Jocher 2 years ago committed by GitHub
parent 202f7bffa3
commit f80ff923e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -18,24 +18,18 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ ubuntu-latest ] os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.10'] python-version: ['3.10']
model: [yolov8n] model: [yolov8n]
torch: [latest] torch: [latest]
# include: include:
# - os: ubuntu-latest - os: ubuntu-latest
# python-version: '3.7' # '3.6.8' min python-version: '3.7' # '3.6.8' min
# model: yolov8n model: yolov8n
# - os: ubuntu-latest - os: ubuntu-latest
# python-version: '3.8' python-version: '3.8' # torch 1.7.0 requires python >=3.6, <=3.8
# model: yolov8n model: yolov8n
# - os: ubuntu-latest torch: '1.7.0' # min torch version CI https://pypi.org/project/torchvision/
# python-version: '3.9'
# model: yolov8n
# - os: ubuntu-latest
# python-version: '3.8' # torch 1.7.0 requires python >=3.6, <=3.8
# model: yolov8n
# torch: '1.7.0' # min torch version CI https://pypi.org/project/torchvision/
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-python@v4 - uses: actions/setup-python@v4
@ -92,13 +86,16 @@ jobs:
run: | run: |
yolo task=detect mode=train model=yolov8n.yaml data=coco128.yaml epochs=1 imgsz=64 yolo task=detect mode=train model=yolov8n.yaml data=coco128.yaml epochs=1 imgsz=64
yolo task=detect mode=val model=runs/detect/train/weights/last.pt imgsz=64 yolo task=detect mode=val model=runs/detect/train/weights/last.pt imgsz=64
yolo task=detect mode=predict model=runs/detect/train/weights/last.pt imgsz=64 source=ultralytics/assets/bus.jpg
- name: Test segmentation - name: Test segmentation
shell: bash # for Windows compatibility shell: bash # for Windows compatibility
run: | run: |
yolo task=segment mode=train model=yolov8n-seg.yaml data=coco128-seg.yaml epochs=1 imgsz=64 yolo task=segment mode=train model=yolov8n-seg.yaml data=coco128-seg.yaml epochs=1 imgsz=64
yolo task=segment mode=val model=runs/segment/train/weights/last.pt data=coco128-seg.yaml imgsz=64 yolo task=segment mode=val model=runs/segment/train/weights/last.pt data=coco128-seg.yaml imgsz=64
yolo task=segment mode=predict model=runs/segment/train/weights/last.pt imgsz=64 source=ultralytics/assets/bus.jpg
- name: Test classification - name: Test classification
shell: bash # for Windows compatibility shell: bash # for Windows compatibility
run: | run: |
yolo task=classify mode=train model=yolov8n-cls.yaml data=mnist160 epochs=1 imgsz=32 yolo task=classify mode=train model=yolov8n-cls.yaml data=mnist160 epochs=1 imgsz=32
yolo task=classify mode=val model=runs/classify/train/weights/last.pt data=mnist160 yolo task=classify mode=val model=runs/classify/train/weights/last.pt data=mnist160 imgsz=32
yolo task=classify mode=predict model=runs/classify/train/weights/last.pt imgsz=32 source=ultralytics/assets/bus.jpg

@ -131,7 +131,7 @@ def smart_request(*args, retry=3, timeout=30, thread=True, code=-1, method="post
@TryExcept() @TryExcept()
def sync_analytics(cfg, all_keys=False, enabled=True): def sync_analytics(cfg, all_keys=False, enabled=False):
""" """
Sync analytics data if enabled in the global settings Sync analytics data if enabled in the global settings

@ -72,7 +72,8 @@ class ClassificationTrainer(BaseTrainer):
imgsz=self.args.imgsz, imgsz=self.args.imgsz,
batch_size=batch_size if mode == "train" else (batch_size * 2), batch_size=batch_size if mode == "train" else (batch_size * 2),
augment=mode == "train", augment=mode == "train",
rank=rank) rank=rank,
workers=self.args.workers)
def preprocess_batch(self, batch): def preprocess_batch(self, batch):
batch["img"] = batch["img"].to(self.device) batch["img"] = batch["img"].to(self.device)

@ -36,7 +36,10 @@ class ClassificationValidator(BaseValidator):
return self.metrics.results_dict return self.metrics.results_dict
def get_dataloader(self, dataset_path, batch_size): def get_dataloader(self, dataset_path, batch_size):
return build_classification_dataloader(path=dataset_path, imgsz=self.args.imgsz, batch_size=batch_size) return build_classification_dataloader(path=dataset_path,
imgsz=self.args.imgsz,
batch_size=batch_size,
workers=self.args.workers)
def print_results(self): def print_results(self):
pf = '%22s' + '%11.3g' * len(self.metrics.keys) # print format pf = '%22s' + '%11.3g' * len(self.metrics.keys) # print format

Loading…
Cancel
Save