Easy integration with yolov8?

I tried the Pytorch integration and it doesn’t work:

from ultralytics import YOLO

import wandb
wandb.init()

# Load a model
model = YOLO("yolov8n.pt")  # load a pretrained model (recommended for training)

# Magic
wandb.watch(model, log_freq=100)

model.train()
for batch_idx, (data, target) in enumerate(train_loader):
    output = model(data)
    loss = F.nll_loss(output, target)
    loss.backward()
    optimizer.step()
    if batch_idx % args.log_interval == 0:
        wandb.log({"loss": loss})


# Use the model
results = model.train(data="coco128.yaml", epochs=3, batch = 2)  # train the model

I get the following:

Traceback (most recent call last):
  File "train.py", line 10, in <module>
    wandb.watch(model, log_freq=100)
  File "/home/henry/.local/bin/.virtualenvs/ultralytics/lib/python3.8/site-packages/wandb/sdk/wandb_watch.py", line 71, in watch
    raise ValueError(
ValueError: Expected a pytorch model (torch.nn.Module). Received <class 'ultralytics.yolo.engine.model.YOLO'>

Hi Danny!

Are you currently following this Yolov5 and Wandb integration report?

Cheers!
Artsiom

Hi Danny,

We wanted to follow up with you regarding your support request as we have not heard back from you. Please let us know if we can be of further assistance or if your issue has been resolved.

Best,
Weights & Biases

Hi danny, since we have not heard back from you we are going to close this request. If you would like to re-open the conversation, please let us know!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.