Representer Error

This category is for question related to accounts on https://app.roboflow.com/

Please share the following so we may better assist you:

  1. Project type (Object detection, Classification, Polygon, etc.)
    Object detection
  2. The operating system & browser you are using and their versions
    Pop os 22.03 lts Firefox 111.01
  3. The screenshot of the error being triggered in your browser’s developer tools/console. Please copy/paste the url below to watch how to pull up your devtools
    keep getting errors. Newest one is:

RepresenterError: (‘cannot represent an object’, <roboflow.core.dataset.Dataset object at 0x7f27813d1ed0>)

Hi @lol - just double-checking, but I’m curious as to why the update to include the dataset download code in model.train()?

That code snippet is for downloading the dataset, and it returns a Dataset object

To get this to run, you’ll want to run the notebook, as originally configured - with the download code separate from the model training code:

  • Dataset download
!mkdir {HOME}/datasets
%cd {HOME}/datasets

!pip install roboflow --quiet

from roboflow import Roboflow
rf = Roboflow(api_key="YOUR_API_KEY")
project = rf.workspace("roboflow-jvuqo").project("football-players-detection-3zvbc")
dataset = project.version(1).download("yolov8")
  • Training code updates (if you’d like to run it in the format you have above), see my screenshot below for an example of it running:
from ultrayltics import YOLO

model = YOLO('yolov8m.yaml')

model.train(data='INSERT_PATH_TO_DATA_YAML-FILE', imgsz=INTEGER_RESIZE_VALUE, epochs=1, device=0)

Note that you’ll want to train for far more than 1 epoch. Train for a minimum of 25 epochs.

I also recommend explicitly setting the imgsz parameter, based on the square resize value you generated your images with: Image Preprocessing - Roboflow

https://docs.ultralytics.com/modes/train/#usage-examples