Training
Start, price, watch and cancel GPU training runs for RF-DETR, YOLOX, segmentation, keypoint and classification models, always from a completed export.
On this page
The training guide walks from reviewed labels to a model.
Pipelines
pipeline_type |
Trains |
|---|---|
rfdetr_detection |
Object detection (RF-DETR) |
yolox |
Object detection (YOLOX) |
rfdetr_segmentation |
Instance segmentation (RF-DETR) |
sm_pytorch |
Semantic segmentation |
rfdetr_keypoint |
Keypoints and pose (RF-DETR) |
classification |
Image classification |
For boxes, see YOLOX or RF-DETR?
GPU tiers
gpu_type |
Memory | Pick for |
|---|---|---|
a10g (default) |
24 GB | YOLOX, classification, RF-DETR detection |
a100 |
40 GB | Large RF-DETR models, big batches |
h100 |
80 GB | A config that doesn’t fit an A100 |
auto |
- | The cheapest tier the config fits; the run reports the tier it got |
quote prices each tier for your config and says which one auto picks. A run uses
one GPU.
Augmentation
config["augmentation"] sets the transforms a run applies to its images as it trains.
Nothing is added to your dataset, and boxes, polygons, masks and keypoints move with the
image.
{
"augmentation": {
"ops": [
{ "op": "flip", "p": 0.5 },
{ "op": "brightness", "factor": 0.2, "p": 0.3 }
],
"framework": { "mosaic_prob": 1.0 }
}
}
Each op has a probability p, from 0 to 1, and its strength:
| Op | Strength |
|---|---|
flip, vflip, rotate90, grayscale |
- |
rotate, hue_shift |
degrees, 0 to 180 |
shear |
degrees, 0 to 45 |
brightness, contrast, saturation |
factor, 0 to 1 |
blur |
radius, 0.1 to 10 |
noise |
amount, 0 to 0.5 |
cutout |
size, 0.05 to 0.9 (of the image) |
Each pipeline takes these ops, and applies its defaults when you leave the block out:
| Pipeline | Ops | Defaults |
|---|---|---|
rfdetr_detection, rfdetr_segmentation |
All of them | flip 0.5 |
rfdetr_keypoint |
All of them | brightness and contrast, factor 0.2 at 0.3 |
yolox |
flip |
flip 0.5 |
sm_pytorch |
flip, vflip, rotate, brightness, contrast, saturation, hue_shift, blur, noise |
flip 0.5 |
classification |
All but rotate90 and shear |
flip 0.5; brightness and contrast 0.2 at 0.3; blur 1 at 0.1 |
framework holds the pipeline’s own settings:
| Pipeline | Key | Range | Default |
|---|---|---|---|
yolox |
mosaic_prob, mixup_prob, hsv_prob |
0 to 1 | 1 |
yolox |
degrees (rotation) |
0 to 45 | 10 |
yolox |
translate |
0 to 0.5 | 0.1 |
yolox |
shear |
0 to 10 | 2 |
sm_pytorch |
perspective |
0 to 1 | 0 |
- RF-DETR always resizes and crops images at random while it trains.
- Flipping a keypoint image swaps its left and right keypoints (
left_eyeandright_eye). - The model’s
config.jsonrecords the augmentation the run applied. - An op the pipeline doesn’t take, or a value out of range, is a
400.
augmentation_profiles returns these tables.
augmentation_profiles
Each pipeline’s augmentation: the ops it takes, its defaults, and its own settings with their ranges. Free for any role.
Source: Training.augmentation_profiles
profiles = client.training.augmentation_profiles().profiles
yolox = profiles["yolox"]
print(yolox.available_ops, [s.key for s in yolox.framework])
pictograph train augmentation-profiles yolox
curl -s "https://api.pictograph.io/api/v1/developer/training/augmentation-profiles" \
-H "X-API-Key: $PICTOGRAPH_API_KEY"
Returns AugmentationProfiles
AugmentationProfiles · 1 field
class AugmentationProfiles(BaseModel):
"""Every pipeline's training-time augmentation (`training.augmentation_profiles`)."""
# By `pipeline_type`.
profiles: dict[str, AugmentationProfile] = {}
create
Start a run on a completed export (how its images are split).
Source: Training.create
| Arg | Type | Default | Notes |
|---|---|---|---|
dataset |
str |
required | Dataset name or id |
export |
str |
required | Name or id of a completed export of the dataset |
pipeline_type |
PipelineType |
required | One of the pipelines |
name |
str |
required | Run name, 1 to 100 characters; the model is named after it |
config |
dict[str, Any] | str | Path | None |
None |
Settings: epochs, batch_size, learning_rate, model_size, image_width, image_height, classes (in index order; default), augmentation and class_overrides; omitted keys take the app’s defaults (hyperparameters); a path loads a model’s config.json |
gpu_type |
GpuType |
"a10g" |
A GPU tier |
version_of |
str | None |
None |
Model to add this run to as its next version |
wait |
bool |
True |
Wait for the run to end; False returns at once with status="queued" |
poll_interval |
float |
5.0 |
Seconds between checks |
timeout |
float |
7200.0 |
Max seconds to wait |
run = client.training.create(
dataset="road-signs",
export="road-signs-20260512-120000",
pipeline_type="yolox",
name="road-signs-detector",
config={"epochs": 50},
gpu_type="a10g",
wait=True,
)
print(run.status, run.model_id)
pictograph train start road-signs road-signs-20260512-120000 \
--pipeline yolox --name road-signs-detector --gpu a10g \
--config '{"epochs": 50}' --no-wait
curl -s -X POST "https://api.pictograph.io/api/v1/developer/training/" \
-H "X-API-Key: $PICTOGRAPH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"dataset": "road-signs", "export": "road-signs-20260512-120000", "pipeline_type": "yolox", "name": "road-signs-detector", "config": {"epochs": 50}, "gpu_type": "a10g"}'
Returns TrainingRun
TrainingRun · 22 fields
class TrainingRun(BaseModel):
"""A single training job."""
id: str
organization_id: str
name: str
# The dataset it trained on.
dataset_id: str | None = None
# The export it trained on.
export_id: str | None = None
# The model it made, once completed.
model_id: str | None = None
pipeline_type: Literal['yolox', 'sm_pytorch', 'classification', 'rfdetr_detection', 'rfdetr_segmentation', 'rfdetr_keypoint', 'patchcore', 'efficientad']
gpu_type: Optional[Literal['a10g', 'a100', 'h100', 'auto']] = None
status: Literal['pending', 'queued', 'running', 'completed', 'failed', 'cancelled']
# 0-100 percent.
progress: int = 0
current_epoch: int = 0
total_epochs: int | None = None
metrics: dict[str, Any] = {}
config: dict[str, Any] = {}
eta_seconds: int | None = None
# Seconds of GPU time the run used, once it completes.
training_time_seconds: int | None = None
error_message: str | None = None
# What was left out of the model and why, such as a class the train split doesn't
# supervise; None when nothing was.
warnings: list[TrainingRunWarning] | None = None
started_at: datetime | None = None
completed_at: datetime | None = None
created_at: datetime
created_by: str | None = None
quote
Check and price a run without starting it, with create’s checks and errors. Free for any
role. It reports:
- the tier the run would use, and what
autopicks - whether the config fits each tier’s memory
- how much of each class the export can train on
- an estimate at the tier’s rate (about 2 minutes an epoch; 10 to 60 minutes a run)
blocking: anything else that would stopcreate, such as the balance or the key’s role
Source: Training.quote
| Arg | Type | Default | Notes |
|---|---|---|---|
dataset |
str |
required | Dataset name or id |
export |
str |
required | Name or id of a completed export of the dataset |
pipeline_type |
PipelineType |
required | As in create |
config |
dict[str, Any] | str | Path | None |
None |
As in create |
gpu_type |
GpuType |
"a10g" |
As in create |
version_of |
str | None |
None |
As in create |
quote = client.training.quote(
dataset="road-signs",
export="road-signs-20260512-120000",
pipeline_type="rfdetr_detection",
config={"epochs": 20},
gpu_type="auto",
)
print(quote.gpu_type, quote.estimate.total_micro_usd / 1_000_000, quote.can_start)
if quote.class_support:
for cls in quote.class_support.classes:
print(cls.name, cls.support, cls.trainable)
pictograph train quote road-signs road-signs-20260512-120000 \
--pipeline rfdetr_detection --gpu auto --config '{"epochs": 20}'
curl -s -X POST "https://api.pictograph.io/api/v1/developer/training/quote" \
-H "X-API-Key: $PICTOGRAPH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"dataset": "road-signs", "export": "road-signs-20260512-120000", "pipeline_type": "rfdetr_detection", "config": {"epochs": 20}, "gpu_type": "auto"}'
Returns TrainingQuote
TrainingQuote · 22 fields
class TrainingQuote(BaseModel):
"""A training run checked and priced without starting it (Training.quote)."""
dataset_id: str
dataset_name: str
export_id: str
export_name: str
image_count: int | None = None
annotation_count: int | None = None
pipeline_type: Literal['yolox', 'sm_pytorch', 'classification', 'rfdetr_detection', 'rfdetr_segmentation', 'rfdetr_keypoint', 'patchcore', 'efficientad']
# What was asked for, `"auto"` included.
requested_gpu_type: str
# The tier the run would use.
gpu_type: str
# Whether the config's predicted peak memory fits `gpu_type`; `None` when the
# pipeline has no estimate.
fits: bool | None = None
# What `gpu_type="auto"` resolves to for this config.
recommended_gpu_type: str | None = None
# The auto-select decision behind `recommended_gpu_type`.
gpu_autoselect: dict[str, Any] | None = None
tiers: list[TrainingQuoteTier] = []
epochs: int
# The classes it would train.
classes: list[str] = []
class_support: TrainingClassSupport | None = None
# Images the export names that were deleted since it was taken.
deleted_images: int | None = None
estimate: TrainingQuoteEstimate
balance: TrainingQuoteBalance
can_start: bool
blocking: list[TrainingQuoteBlock] = []
# The config the run would be stored with.
config: dict[str, Any] = {}
wait_for_completion
Wait for a run started with create(wait=False).
Source: Training.wait_for_completion
| Arg | Type | Default | Notes |
|---|---|---|---|
run |
str |
required | Run name or id |
poll_interval |
float |
5.0 |
Seconds between checks |
timeout |
float |
7200.0 |
Max seconds to wait |
run = client.training.wait_for_completion(
run="road-signs-detector",
poll_interval=5.0,
timeout=7200.0,
)
if run.status == "completed":
model = client.models.get(model=run.model_id)
print(model.name, model.metrics)
pictograph train wait road-signs-detector --timeout 7200
# Poll the get endpoint until "status" reaches a terminal value.
curl -s "https://api.pictograph.io/api/v1/developer/training/$RUN_ID" \
-H "X-API-Key: $PICTOGRAPH_API_KEY"
Returns TrainingRun
TrainingRun · 22 fields
class TrainingRun(BaseModel):
"""A single training job."""
id: str
organization_id: str
name: str
# The dataset it trained on.
dataset_id: str | None = None
# The export it trained on.
export_id: str | None = None
# The model it made, once completed.
model_id: str | None = None
pipeline_type: Literal['yolox', 'sm_pytorch', 'classification', 'rfdetr_detection', 'rfdetr_segmentation', 'rfdetr_keypoint', 'patchcore', 'efficientad']
gpu_type: Optional[Literal['a10g', 'a100', 'h100', 'auto']] = None
status: Literal['pending', 'queued', 'running', 'completed', 'failed', 'cancelled']
# 0-100 percent.
progress: int = 0
current_epoch: int = 0
total_epochs: int | None = None
metrics: dict[str, Any] = {}
config: dict[str, Any] = {}
eta_seconds: int | None = None
# Seconds of GPU time the run used, once it completes.
training_time_seconds: int | None = None
error_message: str | None = None
# What was left out of the model and why, such as a class the train split doesn't
# supervise; None when nothing was.
warnings: list[TrainingRunWarning] | None = None
started_at: datetime | None = None
completed_at: datetime | None = None
created_at: datetime
created_by: str | None = None
get
A run’s current status, progress and metrics.
Source: Training.get
| Arg | Type | Default | Notes |
|---|---|---|---|
run |
str |
required | Run name or id |
run = client.training.get(run="road-signs-detector")
print(run.status, run.progress, run.current_epoch, "/", run.total_epochs)
pictograph train status road-signs-detector
curl -s "https://api.pictograph.io/api/v1/developer/training/$RUN_ID" \
-H "X-API-Key: $PICTOGRAPH_API_KEY"
Returns TrainingRun
TrainingRun · 22 fields
class TrainingRun(BaseModel):
"""A single training job."""
id: str
organization_id: str
name: str
# The dataset it trained on.
dataset_id: str | None = None
# The export it trained on.
export_id: str | None = None
# The model it made, once completed.
model_id: str | None = None
pipeline_type: Literal['yolox', 'sm_pytorch', 'classification', 'rfdetr_detection', 'rfdetr_segmentation', 'rfdetr_keypoint', 'patchcore', 'efficientad']
gpu_type: Optional[Literal['a10g', 'a100', 'h100', 'auto']] = None
status: Literal['pending', 'queued', 'running', 'completed', 'failed', 'cancelled']
# 0-100 percent.
progress: int = 0
current_epoch: int = 0
total_epochs: int | None = None
metrics: dict[str, Any] = {}
config: dict[str, Any] = {}
eta_seconds: int | None = None
# Seconds of GPU time the run used, once it completes.
training_time_seconds: int | None = None
error_message: str | None = None
# What was left out of the model and why, such as a class the train split doesn't
# supervise; None when nothing was.
warnings: list[TrainingRunWarning] | None = None
started_at: datetime | None = None
completed_at: datetime | None = None
created_at: datetime
created_by: str | None = None
list
One page of training runs in your organization.
Source: Training.list
| Arg | Type | Default | Notes |
|---|---|---|---|
dataset |
str | None |
None |
Only this dataset’s runs |
status |
TrainingStatus | None |
None |
Only runs in this state, e.g. running |
limit |
int |
50 |
Page size (max 100) |
offset |
int |
0 |
Items to skip |
for run in client.training.list(status="running", limit=20):
print(run.id, run.name, run.status, run.progress)
pictograph train list --status running --limit 20
curl -s "https://api.pictograph.io/api/v1/developer/training/?limit=20&status=running" \
-H "X-API-Key: $PICTOGRAPH_API_KEY"
Returns list[TrainingRun]
TrainingRun · 22 fields
class TrainingRun(BaseModel):
"""A single training job."""
id: str
organization_id: str
name: str
# The dataset it trained on.
dataset_id: str | None = None
# The export it trained on.
export_id: str | None = None
# The model it made, once completed.
model_id: str | None = None
pipeline_type: Literal['yolox', 'sm_pytorch', 'classification', 'rfdetr_detection', 'rfdetr_segmentation', 'rfdetr_keypoint', 'patchcore', 'efficientad']
gpu_type: Optional[Literal['a10g', 'a100', 'h100', 'auto']] = None
status: Literal['pending', 'queued', 'running', 'completed', 'failed', 'cancelled']
# 0-100 percent.
progress: int = 0
current_epoch: int = 0
total_epochs: int | None = None
metrics: dict[str, Any] = {}
config: dict[str, Any] = {}
eta_seconds: int | None = None
# Seconds of GPU time the run used, once it completes.
training_time_seconds: int | None = None
error_message: str | None = None
# What was left out of the model and why, such as a class the train split doesn't
# supervise; None when nothing was.
warnings: list[TrainingRunWarning] | None = None
started_at: datetime | None = None
completed_at: datetime | None = None
created_at: datetime
created_by: str | None = None
iter
Every run, fetched page by page.
Source: Training.iter
| Arg | Type | Default | Notes |
|---|---|---|---|
dataset |
str | None |
None |
Only this dataset’s runs |
status |
TrainingStatus | None |
None |
Only runs in this state, e.g. running |
page_size |
int |
50 |
Items fetched per request |
max_total |
int | None |
None |
Stop after this many items |
for run in client.training.iter(page_size=50):
print(run.id, run.status, run.progress)
# The CLI does not auto-page; this is a single page.
pictograph train list --limit 100
curl -s "https://api.pictograph.io/api/v1/developer/training/?limit=100&offset=100" \
-H "X-API-Key: $PICTOGRAPH_API_KEY"
Returns OffsetPager[TrainingRun]
TrainingRun · 22 fields
class TrainingRun(BaseModel):
"""A single training job."""
id: str
organization_id: str
name: str
# The dataset it trained on.
dataset_id: str | None = None
# The export it trained on.
export_id: str | None = None
# The model it made, once completed.
model_id: str | None = None
pipeline_type: Literal['yolox', 'sm_pytorch', 'classification', 'rfdetr_detection', 'rfdetr_segmentation', 'rfdetr_keypoint', 'patchcore', 'efficientad']
gpu_type: Optional[Literal['a10g', 'a100', 'h100', 'auto']] = None
status: Literal['pending', 'queued', 'running', 'completed', 'failed', 'cancelled']
# 0-100 percent.
progress: int = 0
current_epoch: int = 0
total_epochs: int | None = None
metrics: dict[str, Any] = {}
config: dict[str, Any] = {}
eta_seconds: int | None = None
# Seconds of GPU time the run used, once it completes.
training_time_seconds: int | None = None
error_message: str | None = None
# What was left out of the model and why, such as a class the train split doesn't
# supervise; None when nothing was.
warnings: list[TrainingRunWarning] | None = None
started_at: datetime | None = None
completed_at: datetime | None = None
created_at: datetime
created_by: str | None = None
cancel
Stop a run.
Source: Training.cancel
| Arg | Type | Default | Notes |
|---|---|---|---|
run |
str |
required | Run name or id |
client.training.cancel(run="road-signs-detector")
pictograph train cancel road-signs-detector --yes
curl -s -X POST "https://api.pictograph.io/api/v1/developer/training/$RUN_ID/cancel" \
-H "X-API-Key: $PICTOGRAPH_API_KEY"
Returns TrainingRun
TrainingRun · 22 fields
class TrainingRun(BaseModel):
"""A single training job."""
id: str
organization_id: str
name: str
# The dataset it trained on.
dataset_id: str | None = None
# The export it trained on.
export_id: str | None = None
# The model it made, once completed.
model_id: str | None = None
pipeline_type: Literal['yolox', 'sm_pytorch', 'classification', 'rfdetr_detection', 'rfdetr_segmentation', 'rfdetr_keypoint', 'patchcore', 'efficientad']
gpu_type: Optional[Literal['a10g', 'a100', 'h100', 'auto']] = None
status: Literal['pending', 'queued', 'running', 'completed', 'failed', 'cancelled']
# 0-100 percent.
progress: int = 0
current_epoch: int = 0
total_epochs: int | None = None
metrics: dict[str, Any] = {}
config: dict[str, Any] = {}
eta_seconds: int | None = None
# Seconds of GPU time the run used, once it completes.
training_time_seconds: int | None = None
error_message: str | None = None
# What was left out of the model and why, such as a class the train split doesn't
# supervise; None when nothing was.
warnings: list[TrainingRunWarning] | None = None
started_at: datetime | None = None
completed_at: datetime | None = None
created_at: datetime
created_by: str | None = None
bulk_cancel
Cancel several runs in one call. A run that has ended, or that isn’t found, is listed in
not_found.
Source: Training.bulk_cancel
| Arg | Type | Default | Notes |
|---|---|---|---|
runs |
Sequence[str] |
required | Run ids |
result = client.training.bulk_cancel(
runs=[
"d1f2a3b4-5c6d-4e70-8f91-a2b3c4d5e6f7",
"e2a3b4c5-6d7e-4f81-9a02-b3c4d5e6f708",
],
)
print(result.count, "cancelled;", result.not_found, "skipped")
pictograph train cancel-batch \
d1f2a3b4-5c6d-4e70-8f91-a2b3c4d5e6f7 e2a3b4c5-6d7e-4f81-9a02-b3c4d5e6f708 --yes
curl -s -X POST "https://api.pictograph.io/api/v1/developer/training/bulk-cancel" \
-H "X-API-Key: $PICTOGRAPH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"runs": ["d1f2a3b4-5c6d-4e70-8f91-a2b3c4d5e6f7", "e2a3b4c5-6d7e-4f81-9a02-b3c4d5e6f708"]}'
Returns BulkActionResult
BulkActionResult · 3 fields
class BulkActionResult(BaseModel):
"""What a bulk change (pause, resume, cancel) did."""
# Ids this call changed.
succeeded: list[str] = []
# Ids not found, or not in a state it could change.
not_found: list[str] = []
# How many were changed.
count: int = 0
Cost
A run is charged once, when it completes, for the GPU time it used, by the second. A failed
or cancelled run is not charged. Starting a run needs at least $2 you can spend.
quote estimates a run; credits.estimate prices minutes on a tier:
estimate = client.credits.estimate(
operation="training_a10g",
quantity=30,
)
if not estimate.sufficient:
raise RuntimeError(f"Need ${estimate.total_usd:.2f}, have ${estimate.remaining_usd:.2f}")
pictograph credits estimate training_a10g --quantity 30
Common errors
| Status | Exception | Cause |
|---|---|---|
| 400 | ValidationError |
The export isn’t completed or has no images, the config is invalid, no class can be trained, or the run being cancelled has ended |
| 402 | PaymentRequiredError |
Less than $2 to spend |
| 403 | ForbiddenError |
A key below member (starting or cancelling a run) |
| 404 | NotFoundError |
The dataset, export or run doesn’t exist |
| 422 | ValidationError |
An unknown pipeline_type or gpu_type |
| - | PollTimeoutError |
The wait passed timeout; the run keeps going |