Repository: wandb/wandb

Issue:
Wandb error on importing callback function from ultralytics integration 
Hi,
Encountered Error on importing Ultralytics integration callback

### Version:
- Wandb: 0.15.12
- Ultralytics: 8.0.203

### Code:
  ```python
  from wandb.integration.ultralytics import add_wandb_callback
  ```

### Error:
```bash
Traceback (most recent call last):
  File "/media/ssd1/anaconda3/envs/py39_rbbox/lib/python3.9/site-packages/wandb/integration/ultralytics/callback.py", line 45, in <module>
    from ultralytics.yolo.utils import RANK, __version__
ModuleNotFoundError: No module named 'ultralytics.yolo'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/media/ssd1/anaconda3/envs/py39_rbbox/lib/python3.9/site-packages/wandb/integration/ultralytics/__init__.py", line 7, in <module>
    from wandb.integration.ultralytics.callback import add_wandb_callback
  File "/media/ssd1/anaconda3/envs/py39_rbbox/lib/python3.9/site-packages/wandb/integration/ultralytics/callback.py", line 64, in <module>
    wandb.error(e)
AttributeError: module 'wandb' has no attribute 'error'
```


### Quick Fix
Found out Ultralytics have re-structured the utils, and removed `yolo`,
quick fixes by updating following line:
https://github.com/wandb/wandb/blob/c6b7a82a152e8efee84cb7f0887532c482ccd6c1/wandb/integration/ultralytics/callback.py#L45
to
```python
from ultralytics.utils import RANK, __version__ 
```


Discussion:
@lowisluo - thank you so much for surfacing this - will flag this with our integrations team and let you know when any updates are made on our end. thank you!
Try using ultralytics 8.0.186
```
!pip install --upgrade ultralytics==8.0.186
```

Experienced same issues; came up with the same solution and worked just the same :)

Resolving patch:
diff --git a/wandb/integration/ultralytics/bbox_utils.py b/wandb/integration/ultralytics/bbox_utils.py
--- a/wandb/integration/ultralytics/bbox_utils.py
+++ b/wandb/integration/ultralytics/bbox_utils.py
@@ -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
 
diff --git a/wandb/integration/ultralytics/callback.py b/wandb/integration/ultralytics/callback.py
--- a/wandb/integration/ultralytics/callback.py
+++ b/wandb/integration/ultralytics/callback.py
@@ -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,
diff --git a/wandb/integration/yolov8/yolov8.py b/wandb/integration/yolov8/yolov8.py
--- a/wandb/integration/yolov8/yolov8.py
+++ b/wandb/integration/yolov8/yolov8.py
@@ -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


Test patch: