Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: wandb/wandb
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: c-core-labs/wandb
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 1 commit
  • 3 files changed
  • 1 contributor

Commits on Dec 16, 2023

  1. fix: Handle ultralytics utils import refactor

    On ModuleNotFound exception from ultralytics.yolo.utils
    try from ultralytics.utils instead.
    
    style: Ruff
    fix: Handle ultralytics import error in bbox_utils
    jthetzel committed Dec 16, 2023
    Copy the full SHA
    077f6aa View commit details
Showing with 15 additions and 4 deletions.
  1. +4 −1 wandb/integration/ultralytics/bbox_utils.py
  2. +4 −1 wandb/integration/ultralytics/callback.py
  3. +7 −2 wandb/integration/yolov8/yolov8.py
5 changes: 4 additions & 1 deletion wandb/integration/ultralytics/bbox_utils.py
Original file line number Diff line number Diff line change
@@ -3,7 +3,10 @@
import torch
from ultralytics.engine.results import Results
from ultralytics.models.yolo.detect import DetectionPredictor
from ultralytics.yolo.utils import ops
try:
from ultralytics.yolo.utils import ops
except ModuleNotFoundError:
from ultralytics.utils import ops

import wandb

5 changes: 4 additions & 1 deletion wandb/integration/ultralytics/callback.py
Original file line number Diff line number Diff line change
@@ -42,7 +42,10 @@
SegmentationValidator,
)
from ultralytics.utils.torch_utils import de_parallel
from ultralytics.yolo.utils import RANK, __version__
try:
from ultralytics.yolo.utils import RANK, __version__
except ModuleNotFoundError:
from ultralytics.utils import RANK, __version__

from wandb.integration.ultralytics.bbox_utils import (
plot_predictions,
9 changes: 7 additions & 2 deletions wandb/integration/yolov8/yolov8.py
Original file line number Diff line number Diff line change
@@ -2,8 +2,13 @@

from ultralytics.yolo.engine.model import YOLO
from ultralytics.yolo.engine.trainer import BaseTrainer
from ultralytics.yolo.utils import RANK
from ultralytics.yolo.utils.torch_utils import get_flops, get_num_params

try:
from ultralytics.yolo.utils import RANK
from ultralytics.yolo.utils.torch_utils import get_flops, get_num_params
except ModuleNotFoundError:
from ultralytics.utils import RANK
from ultralytics.utils.torch_utils import get_flops, get_num_params
from ultralytics.yolo.v8.classify.train import ClassificationTrainer

import wandb