Skip to content

DOCS-5068: Restructure Train ML models for every model type - #5487

Merged
Eliza Farley (elizafarley) merged 31 commits into
mainfrom
claude/local-train-model-changes-5f5427
Nov 6, 2026
Merged

Eliza Farley (elizafarley) merged 31 commits into
mainfrom
claude/local-train-model-changes-5f5427

Conversation

@elizafarley

@elizafarley Eliza Farley (elizafarley) commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Jira: DOCS-5068 (stage 1 of DOCS-5063) and DOCS-4213. The plan in DOCS-5063 is up to date with this PR.

The Train ML models section no longer assumes every model is an image classifier or object detector. It's organized around the stages every model goes through, and it covers robot policies and Other models alongside vision models.

Changes

Overview (train/overview.md), rewritten:

  • When to use an existing or uploaded model instead of training
  • Types of models: the five task types, each with an example, example base models, and which training method takes it
  • How training works: the training loop (new diagram, static/train/training-flywheel.svg) from capturing data to retraining, with an Evaluate stage
  • Built-in or custom training: when to use each, a comparison table, and what the framework decides
  • What's next replaces the section cards

Built-in training (train/train-a-model.md), retitled "Train a vision model with built-in training":

  • The intro scopes the page to vision models and links to Built-in or custom training for everything else
  • Prerequisites, with the dataset minimums moved here from create-a-dataset.md
  • A Choose a framework table (TFLite or TensorFlow)
  • Steps for starting and monitoring a job, each with Viam app, CLI, Python and Go tabs. A last step verifies the model and links to evaluation.
  • The Upload your training script and Parse command line inputs sections are removed. The Viam app links to their anchors, so the anchors are kept as empty <span id> elements.

Custom training (train/custom-training-scripts.md), retitled "Train a model with a custom training script", is now a standard how-to:

  • Prerequisites (CLI 1.15.0 or later for robot_policy, Docker)
  • Seven numbered steps: find an existing script in the registry, plan the script (dataset type, model it produces, container), write, test locally, upload, submit, and verify
  • Troubleshooting
  • Covers every task type and the Registry framework, with labels.txt guidance for models you want to evaluate
  • File formats move to the new reference page. Existing anchors are kept.

Training dataset formats (train/dataset-formats.md) replaces train/sequence-dataset-format.md, with an alias. It covers the training script arguments, the binary and sequence dataset files, and the training job environment.

Evaluate a model (train/evaluate-a-model.md) is a new how-to. It runs a classification or detection model on a labeled test dataset from the dataset's Evaluations page, and reads precision, recall and F1 for each label.

Deploy a model (train/deploy-a-model.md):

  • A new What runs the model section is now the only framework and hardware table, and covers the Registry framework
  • Deploy the model covers every framework, with Viam app (model page or CONFIGURE tab), Python and Go tabs. The Python and Go tabs add the module, package and resource with update_robot_part, including for a Registry model.
  • The vision service is optional, for classification and detection models only
  • New Verify the model loaded and Troubleshooting sections. Use the model in code is removed; What's next links the vision pipeline, the ML model service API and fleet deployment.

Create a dataset (train/create-a-dataset.md):

  • Add data and Export a dataset have one tab per interface, and each tab says what it supports for binary and sequence datasets
  • Prepare a dataset for training (labeling, quality recommendations, verification) applies to both dataset types and both training methods

Annotate data (train/annotate-data.md), renamed from annotate-images.md with an alias:

  • Viam app, Python and Go tabs for tagging images and drawing bounding boxes
  • A new Tag sequences section, with Python, Go and TypeScript tabs

Other pages:

  • Link and wording updates: vision/configure.md, vision/overview.md, vision/deploy-and-maintain/retrain.md (links evaluation), deploy-custom-model.md, batch-inference.md, train/automate-annotation.md (Run model > Get auto-predictions), train/custom-containers.md, data/sequences.md, data/sequences-tutorial.md, data/tag-data.md, and the ML glossary term
  • vision/deploy-and-maintain/deploy-from-registry.md drops its framework table and links to What runs the model. Its #model-framework-support heading stays, because the Viam app links to it.
  • assets/train/task-types.png is removed

Not in this PR

Removing the duplication between Train ML models and the vision Deploy and maintain models section happens in a follow-up PR, #5492, stacked on this one. This PR only replaces the framework table in deploy-from-registry.md with a link. #5492 gives model versions one home in train/deploy-a-model.md, merges vision/deploy-and-maintain/roll-out-to-fleet.md into fleet/deploy-ml-models.md, and changes the vision pages to link to Train instead of restating it.

Verification

Verified against source (app origin/main at 0678a15, 47c502e and d951608; rdk origin/main):

  • Task type names (Single label classification, Multi label classification, Object detection, Robot policy, Other = UNSPECIFIED): app ui/src/lib/ml-model.ts:385-399
  • Built-in training rejects Robot policy and unspecified task types: app mltraining/internal_ml_training_service.go:196-202. It's disabled for sequence datasets: training-first-screen.svelte:24,95-110.
  • Dataset minimums (80% labeled, 10 per label, 15 total for detection) are skipped for custom jobs: app mltraining/training_job_manager.go:810, constants at internal_ml_training_service.go:37-43. The two-label minimum applies only to multi label classification: ml_training_service.go:251.
  • SDK jobs always train TFLite: app mltraining/ml_training_service.go:227-231
  • Completion and failure emails: mltraining/training_job_manager.go:1037-1053,1430-1448
  • A custom job takes its task type, framework and module resources from the training script: app mltraining/ml_training_service.go:389-424
  • Frameworks and the module each deploys with: app ui/src/lib/ml-model.ts:526-533, ui/src/lib/rdk/ml-model.ts:226-268
  • Deploy dialog: one name per module resource for Registry; the vision step only for non-Registry deploys; Include Vision service defaults on only for vision types: deploy-model-dialog.svelte:460-465,547-567,728-742,933, ui/src/lib/ml-model-deploy.ts:97-108
  • A manual Registry deploy sets model_path to ${packages.ml_model.<name>}: app ui/src/lib/ml-model.ts:106-117,172-174, ui/src/lib/rdk/ml-model.ts:31-32,124-140
  • Auto-predictions and cloud inference accept only vision types in TF, TFLite or ONNX: app ui/src/lib/inference.ts:47-67
  • Viam-managed containers: app etc/migrations/add_training_containers/viam_containers.json
  • Registry filter for training scripts (?type=Training+Script): app ui/src/routes/registry/registry-context.svelte.ts:43-59
  • CLI --type includes robot_policy and unspecified: rdk cli/ml_training.go:709-721. robot_policy shipped in CLI v1.15.0 (rdk#6674).
  • viam dataset export --only-jsonl: rdk cli/dataset.go:265,374-386, utils machinelearning/image_metadata_to_JSON.go:124-150
  • UpdateSequence replaces sequence_tags and requires a field mask: app domains/datamanagement/sequences.go
  • The Viam app can't download a sequence dataset: sequence-dataset-sidebar.svelte:319-329
  • TypeScript can add images to a dataset: viam-typescript-sdk src/app/data-client.ts:1056
  • DATA > MODELS lists models with an Active Training section, and a model's details page lists its versions: app routes/(auth-required)/models/models-page-main.svelte, [registry_item_name]/model-versions-table.svelte

Evaluate a model (app d951608, api, rdk, Python and TypeScript SDKs):

  • Entry points Run model > Evaluate model performance and Evaluations > New evaluation: dataset-sidebar.svelte:198-218,661-766, evaluations-page-main.svelte
  • Accepted models (no Robot policy or unspecified; TF, TFLite or ONNX only): ui/src/lib/evaluation.ts:12-35, mlinference/batch_evaluation_job_topic.go
  • Thresholds (defaults 0.5, IoU for detection only, fixed after start): evaluation-config-dialog.svelte, mlinference/internal_ml_inference_service.go:178-183
  • JPEG and PNG only: batch_evaluation_job_topic.go:205. Read-only: batch_evaluation_job_topic.go:150.
  • Scoring: mlinference/evaluation/evaluate.go:20-180, accumulator.go:47-97
  • Billing (each image is one cloud inference): batch_worker_common.go:215, ml_inference_service.go:321
  • No CLI, SDK or public API: no EvaluationJob in rdk, api, viam-python-sdk or viam-typescript-sdk
  • Statuses, columns and per-class breakdown: evaluations/evaluation-status-pill.svelte, evaluation-job-row.svelte, evaluations-table.svelte, class-metrics-table.svelte. Failure messages: batch_worker_common.go:55-85.

Code samples tested (Python SDK 0.85.2, rdk/CLI 1.15.0, TypeScript SDK 0.79.0, in a test org; test data cleaned up afterwards):

  • Every Python, Go and TypeScript sample type-checks or compiles against the current SDKs.
  • Run live: creating binary and sequence datasets and adding images and sequences (Python, Go, TypeScript, CLI); tagging images, drawing bounding boxes and tagging sequences (Python, Go, TypeScript); exporting both dataset types, with layouts matching dataset-formats.md; listing and getting training jobs and reading logs (Python, Go, CLI); viam train containers list.
  • Deploy a model: the Python and Go samples write the expected module, package and service entries to a machine part. A Python write with a stale last_known_update is rejected with FAILED_PRECONDITION.
  • Custom training: the binary script ran in Docker with viam training-script test-local and wrote model.tflite and labels.txt. The sequence script ran against a real export, and every image path resolved. Both ran without Docker with the commands on the page.
  • Fixed from testing: the binary "Run without Docker" command now runs from the export directory, since dataset.jsonl image paths are relative to it, and viam dataset data add filter uses --location-ids.
  • The flags in viam train submit managed, viam train submit custom from-registry and viam training-script upload match the CLI's help.

Not run: training jobs weren't submitted and no training script was uploaded. The deployed model wasn't loaded on a running machine. The evaluation flow wasn't clicked through in the Viam app.

Checks: prettier 3.2.5, markdownlint, vale 3.12.0, frontmatter_rules.py and make build-prod pass. docs-skills checkers report no errors on the pages this PR restructures. The remaining warnings are kept:

  • overview.md: EX-01, because the title is the section's name.
  • train-a-model.md: HT-17, because "Choose a framework" names the choice.
  • evaluate-a-model.md: HT-01 ("Evaluate" is a verb) and HT-03 (the intro note is deliberate).
  • custom-training-scripts.md: HT-16, because the page is 2,011 words.

🤖 Generated with Claude Code

Stage 1 of the DOCS-5063 content plan: rewrite the Train ML models
overview around task type, training method, and framework; retitle
train-a-model.md to "Train a vision model" and restructure it; make
deploy-a-model.md the shared deploy stage; update custom training
scripts for every task type and the Registry framework; update the ML
glossary term.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@viambot viambot added the safe to build This pull request is marked safe to build from a trusted zone label Nov 2, 2026
@netlify

netlify Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for viam-docs ready!

Name Link
🔨 Latest commit 277560c
🔍 Latest deploy log https://app.netlify.com/projects/viam-docs/deploys/6aee0eb57c1b58dc0e4967b4
😎 Deploy Preview https://deploy-preview-5487--viam-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 42 (🟢 up 7 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

…l diagram

- Say that training fine-tunes a pretrained model, and introduce built-in
  training and custom training scripts (with custom containers) in the intro.
- Replace the text diagram with a circular SVG showing the
  capture, dataset, train, deploy, use loop, and add a Capture data stage.
- Describe how built-in training fine-tunes a pretrained image model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Number the training loop steps and rename "Use" to "Run" (page and diagram)
- Link capture to the capture and sync overview; mention labeling in the dataset step
- Drop the custom container line from the intro, the app-features list, and
  the "How the choices fit together" table
- Replace the framework table's "Produced by" column with hardware support
- Reword task type intro and dataset column for robot policy and Other

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Trim Training method to what the intro doesn't already say
- Remove the task type image (now unused) and the Other paragraph
- Remove Automatic deployment and Dataset versioning

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nce tagging

- Add data and Export: one tab per interface, each saying what it supports
  for binary and sequence datasets.
- Prepare a dataset for training: label data (including adding a task tag
  to an existing sequence), general quality recommendations, and
  programmatic quality checks (CLI + jq, Python).
- Platform requirements renamed to Built-in training requirements; custom
  training jobs skip these checks (app mltraining/training_job_manager.go).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Moves the sequence-tagging examples from create-a-dataset into a new
Tag sequences section on the annotation page, which now covers both
image labels and sequence task tags. /train/annotate-images/ stays as an
alias; inbound links point at the new URL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er sidebar

- Sidebar labels "Built-in training" and "Custom training" so the two
  methods read as a pair, matching the overview and the app's Train model
  dialog. Page titles keep the task: "Train a vision model with built-in
  training" and "Train a model with a custom training script". URLs unchanged.
- Replace "managed training" with "built-in training" in prose (CLI
  `submit managed` references left as is).
- Reorder the Train section: overview, create a dataset, annotate data,
  built-in training, custom training, deploy a model, automate annotation,
  custom training containers, sequence dataset format.
- Fix two existing em dashes in vision/configure.md that vale flags now
  that the file is touched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… training scripts

- create-a-dataset: Verify dataset quality drops the CLI and Python scripts
  for a short note on pulling dataset contents from the CLI or Python SDK.
- Built-in training minimums move to train-a-model's Prerequisites.
- train-a-model: "Test against a test dataset" is now "Evaluate against a
  test dataset".
- annotate-data: Viam app steps are a tab beside the Python and Go tabs.
- custom-training-scripts: new Find an existing training script section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l in code

Splits the section by what runs the model: vision service for
classification and detection, the named module resource for Registry
models such as robot policies, and the ML model service's metadata and
infer for Other models.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…try models

- train-a-model: alert at the top says built-in training only makes image
  classification and detection models, with examples of when to use a
  custom training script instead.
- deploy-a-model: the CONFIGURE-tab steps say they cover any model in an
  ML model service, add a verify step for non-vision models, and add
  Deploy a Registry model manually (module resource + package +
  model_path, matching what the deploy dialog writes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…built-in vs custom

Move the framework-to-runtime table into Deploy a model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-in training

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…vs custom column

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o one reference

Reorder the how-to into find, plan, write, test, upload, submit, monitor.
Move container choice into planning, since test-local and submit both
require --container-id. Fold 'Match your output' into planning as the
model's task type and framework. Move the binary JSONL format, the
argument table, and API credentials to a renamed Training dataset formats
reference (aliased from /train/sequence-dataset-format/).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New docs/train/evaluate-a-model.md covers running a vision model against
a labeled test dataset from the dataset's Evaluations tab, and what
evaluation doesn't support. train-a-model.md's step 3 now links to it in
place of the auto-predictions stand-in and the Test on a machine section,
which duplicated deploy-a-model.md's Verify step; both old anchors are
kept. The overview, retrain.md and automate-annotation.md link to it, and
automate-annotation.md now has Get auto-predictions under Run model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…view

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread docs/train/overview.md Resolved
Comment thread docs/train/overview.md Resolved
Comment thread docs/train/overview.md Resolved
Comment thread docs/train/overview.md Resolved
Comment thread docs/train/overview.md Resolved
Comment thread docs/train/overview.md Resolved
…els overview

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Make deploy-a-model's What runs the model the only framework and
  hardware table; the vision pages link to it. deploy-from-registry
  keeps its #model-framework-support heading, which the Viam app links
  to, as a pointer.
- robot_policy needs CLI 1.15.0 or later (rdk#6674 shipped in v1.15.0).
- The two-label minimum applies only to multi label classification
  (mltraining/ml_training_service.go:251).
- Shorten the Train ML models overview description to under 160
  characters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Note which models built-in evaluation supports, and add a labels.txt
  bullet for scripts whose models you want to evaluate
- Say when to use the Registry framework and link to writing a module
  (follow-up: DOCS-5085)
- Make the Viam-managed container description version-agnostic
- Move the test-local binary-only limit and GPU pricing into alerts
- Move the with-upload tip to the CLI submit tab
- Put the job-notification text above the monitoring tabs
- Drop the duplicate classification-tflite link; link evaluation in
  What's next

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- custom-training-scripts: standard how-to shape with numbered steps,
  Prerequisites (CLI minimum, Docker), a Verify step, and its own
  Troubleshooting section; link to the overview for frameworks
- train-a-model: replace the custom-script alert with one sentence
  linking to Built-in or custom training; end on a Verify step
- create-a-dataset: confirm added data, link to dataset-formats for
  the sequence export layout, drop a duplicate troubleshooting tip,
  update link text
- annotate-data: tab order, placeholders, HTML comment for missing
  tabs, a confirm line, link text
- overview: What's next cut to four links, two duplicate links removed
- evaluate-a-model: billing caution in step 2
- dataset-formats: restore the closing See line

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…leshooting into Train restructure

Brings in #5503 (custom jobs that fail waiting for a GPU) and #5507
(training job status labels). Restates the status sentence and the
queued troubleshooting entry with the app's current labels, and moves
the GPU-wait section into the new expand-style troubleshooting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… tabs

- One deploy step: the Deploy dialog or a CONFIGURE-tab Blocks search in the
  Viam app, or get_robot_part/update_robot_part from Python and Go
- What runs the model lists each framework's module and resource model
- Vision service is optional and links to Configure a vision pipeline
- Use the model in code and vision troubleshooting removed; What's next routes
  by model type

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n-ids flag

Running the binary training script from inside my-training/ can't find the
images, because dataset.jsonl paths are relative to the export directory.
viam dataset data add filter takes --location-ids, not --location-id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nnotation tip

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@viambot

viambot commented Nov 6, 2026

Copy link
Copy Markdown
Member

It looks like the following files may have been renamed. Please ensure you set all needed aliases:

 rename docs/train/{annotate-images.md => annotate-data.md} (54%)
 rename docs/train/{sequence-dataset-format.md => dataset-formats.md} (45%)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General note: the CLI reference needs the same test-local fix this PR makes in custom-training-scripts.md.

This PR's test-local example (--dataset-root=. plus --dataset-file=<destination>/dataset.jsonl, run from the directory where viam dataset export ran) matches how the CLI behaves. viam dataset export --destination=X records each image path in dataset.jsonl as X/data/<file>, relative to the directory you ran the export from, and test-local mounts --dataset-root as the container's working directory (checked against rdk v1.15.0: cli/dataset.go, cli/ml_training.go).

docs/cli/datasets-and-training.md still shows the old form, and it contradicts that:

viam dataset export ... --destination=./my-dataset      # l.121–131

viam training-script test-local \
  --dataset-root=./my-dataset/ \                        # l.276
  --dataset-file=dataset.jsonl \                        # l.278
  ...

With that export, the JSONL paths are my-dataset/data/<file>, so with --dataset-root=./my-dataset/ they resolve to my-dataset/my-dataset/data/<file> and the images aren't found. Suggested fix, run from the directory where the export ran:

viam training-script test-local \
  --dataset-root=. \
  --dataset-file=my-dataset/dataset.jsonl \
  --training-script-directory=./my-training-script/ \
  --container-id=<container-id> \
  --model-output-directory=./output/

Since the new page and the CLI reference would otherwise disagree on the same command, it seems worth fixing the reference in this PR.

Comment thread docs/train/overview.md
A typical active-learning loop:
**3. Train.**
A training job reads the dataset in the cloud and publishes the result as a new model version in your organization's registry.
[Built-in training](/train/train-a-model/) needs no code; a [custom training script](/train/custom-training-scripts/) runs your own code.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old overview documented dataset snapshotting at train time ("Each time you train a model from a dataset, Viam snapshots the dataset's contents at that point..."). This PR removes that section and nothing restates it. Suggested wording here, since this is where it happens:

Suggested change
[Built-in training](/train/train-a-model/) needs no code; a [custom training script](/train/custom-training-scripts/) runs your own code.
[Built-in training](/train/train-a-model/) needs no code; a [custom training script](/train/custom-training-scripts/) runs your own code.
When you start a training job, Viam snapshots the dataset's contents at that point, so the model is trained on exactly the images and labels the dataset held at that moment.
You can keep adding, labeling and removing data afterward without affecting models you've already trained.
To train on the changes, start a new training job.

Worth confirming that snapshotting applies to custom-script jobs as well as built-in training.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 277560c. Stage 3 now says Viam snapshots the dataset when the job starts, so later changes don't affect running jobs or trained models. I said "data and labels" so it also covers sequence datasets. Confirmed it applies to custom-script jobs too: the backend builds the training dataset when it processes the job, for built-in and custom jobs alike.

Comment thread docs/train/overview.md Outdated
Viam's managed training handles TFLite and TensorFlow directly. For PyTorch,
ONNX, or other frameworks, write a [custom training script](/train/custom-training-scripts/).
**Retrain.**
You add data from the cases where the model struggles to the dataset, train a new version, and machines configured to use the model pick it up.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old overview had an "Automatic deployment" section ("If a machine is already configured to use that model, Viam automatically deploys the new version... No manual download or restart is needed."). This PR reduces it to "pick it up". Suggested wording, which also fixes the "struggles to the dataset" adjacency:

Suggested change
You add data from the cases where the model struggles to the dataset, train a new version, and machines configured to use the model pick it up.
In cases where the model struggles, you add data to the dataset and train a new version.
When training completes, a machine that is already configured to use the model gets the new version automatically.
It pulls the latest version the next time it checks for updates, with no manual download or restart.

Worth confirming whether this applies only to machines whose package entry uses version: latest, since the deploy page's examples pin that field.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 277560c, using your wording for the first sentence. The auto-update sentence is limited to machines whose config uses the model's latest version. One note: the deploy page's examples use "version": "latest" rather than pinning it, so the two pages agree.

Comment thread docs/train/annotate-data.md Outdated
logger.Fatal(err)
}
err = dataClient.UpdateSequence(ctx, "<sequence-id>", &app.UpdateSequenceOptions{
SequenceTags: append(sequence.SequenceTags, "pick-up-cup"),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetSequence returns a struct whose SequenceTags slice may have spare capacity, so append onto it can write into the fetched sequence's backing array. Copying first matches what the Python (list(...) + [...]) and TypeScript ([...]) examples already do:

Suggested change
SequenceTags: append(sequence.SequenceTags, "pick-up-cup"),
SequenceTags: append(slices.Clone(sequence.SequenceTags), "pick-up-cup"),

This needs import "slices".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 277560c. sequenceFromProto passes the proto slice straight through, so the clone is needed. I left out import "slices" because the Go snippets on this page don't show their imports.

Comment thread docs/train/annotate-data.md Outdated
Comment on lines +211 to +214
undefined,
[...sequence.sequenceTags, "pick-up-cup"],
undefined,
undefined,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updateSequence takes its arguments positionally (id, resources, sequenceTags, startTime, endTime, fieldMask), so the undefined placeholders can't be removed. Labeling them shows which argument each one is:

Suggested change
undefined,
[...sequence.sequenceTags, "pick-up-cup"],
undefined,
undefined,
undefined, // resources
[...sequence.sequenceTags, "pick-up-cup"],
undefined, // startTime
undefined, // endTime

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 277560c.

id="<sequence-id>",
sequence_tags=list(sequence.sequence_tags) + ["pick-up-cup"],
)
```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go and TypeScript both say the field mask is required, but this tab doesn't mention it. In the Python SDK, update_sequence builds the field mask itself from whichever arguments are not None (verified in viam-sdk 0.85.2). A one-line note keeps the three tabs consistent:

Suggested change
```

The SDK builds the field mask from the arguments you pass, so you don't set it yourself.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 277560c. Confirmed against update_sequence on the Python SDK's main branch.

your training images were taken on a clean desk, the model will not generalize.
Capture images under production conditions -- with the actual lighting,
Capture data under production conditions -- with the actual lighting,
background, camera angle, and distance your machine uses.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR removes the "list your organization's datasets from code" snippets (list_datasets_by_organization_id / ListDatasetsByOrganizationID), and nothing replaces them. Both methods exist in the current SDKs (checked viam-python-sdk v0.85.2 and rdk v1.15.0), and custom-training-scripts.md still tells readers to "get the dataset ID" from the DATASETS tab or viam dataset list, so SDK-only users no longer have a documented way to enumerate datasets. Suggested restoration, in the page's existing snippet style:

Suggested change
background, camera angle, and distance your machine uses.
background, camera angle, and distance your machine uses.
To list your organization's datasets and their IDs from code:
{{< tabs >}}
{{% tab name="Python" %}}
```python
async def main():
viam_client = await connect()
data_client = viam_client.data_client
datasets = await data_client.list_datasets_by_organization_id(
organization_id="YOUR-ORG-ID",
)
for ds in datasets:
print(f"Dataset: {ds.name}, ID: {ds.id}")
viam_client.close()
```
{{% /tab %}}
{{% tab name="Go" %}}
```go
datasets, err := dataClient.ListDatasetsByOrganizationID(ctx, "YOUR-ORG-ID")
if err != nil {
logger.Fatal(err)
}
for _, ds := range datasets {
fmt.Printf("Dataset: %s, ID: %s\n", ds.Name, ds.ID)
}
```
{{% /tab %}}
{{< /tabs >}}

If you'd rather not repeat it here, a one-line pointer to the data client API reference would also work. This section is also an odd home for it: the snippet is about finding IDs, not verifying quality, so the Create a dataset section might suit it better.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 277560c with the lighter option, placed in the Create a dataset section as you suggested: one line pointing to the DATASETS tab, viam dataset list, and ListDatasetsByOrganizationID in the data client API reference.

Comment thread docs/train/deploy-a-model.md Outdated

## Deploy from the machine's configure tab
The first four are ML model services (API `rdk:service:mlmodel`).
To run a TensorFlow, PyTorch or ONNX model on an Nvidia GPU, configure the [`triton`](https://app.viam.com/module/viam/mlmodelservice-triton-jetpack) ML model service instead.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old table in deploy-from-registry.md carried a note that GPU-capable ML model services (such as Triton on Jetson) can be configured to use either the CPU or the dedicated GPU at runtime. That note is gone from this PR, and the new sentence says "Nvidia GPU" without saying Triton is the Jetson option. Suggested wording restores both:

Suggested change
To run a TensorFlow, PyTorch or ONNX model on an Nvidia GPU, configure the [`triton`](https://app.viam.com/module/viam/mlmodelservice-triton-jetpack) ML model service instead.
To run a TensorFlow, PyTorch or ONNX model on an Nvidia GPU, such as a Jetson, configure the [`triton`](https://app.viam.com/module/viam/mlmodelservice-triton-jetpack) ML model service instead.
You can configure `triton` to use either the CPU or the dedicated GPU at runtime.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 277560c: the sentence now names the Jetson and adds that triton can use either the CPU or the GPU at runtime.

… test-local

- overview: restate dataset snapshot at job start and auto-update for `latest`
- annotate-data: clone Go tags slice, label TS undefined args, Python field-mask note
- create-a-dataset: pointer to finding dataset IDs (app, CLI, ListDatasetsByOrganizationID)
- deploy-a-model: triton is the Jetson option and can run on CPU or GPU
- cli reference: fix test-local dataset-root/dataset-file to match export paths

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@viambot

viambot commented Nov 6, 2026

Copy link
Copy Markdown
Member

It looks like the following files may have been renamed. Please ensure you set all needed aliases:

 rename docs/train/{annotate-images.md => annotate-data.md} (53%)
 rename docs/train/{sequence-dataset-format.md => dataset-formats.md} (45%)

@elizafarley

Copy link
Copy Markdown
Contributor Author

Re the test-local note on the CLI reference: fixed in 277560c. docs/cli/datasets-and-training.md now uses --dataset-root=. and --dataset-file=my-dataset/dataset.jsonl, and says to run it from the directory where viam dataset export ran.

@elizafarley

Copy link
Copy Markdown
Contributor Author

Docs review: Needs changes

This PR restructures Train ML models around the training loop. It adds Evaluate a model and Training dataset formats, and rewrites the built-in, custom, deploy, dataset and annotation pages. The content checks out against source. One release question is left: the evaluation UI and the new Run model menu are behind a feature flag that defaults to off, and the code can't tell whether it's on for all orgs.

CI: All required checks passing

Docs health: No regressions. Both new pages are scored, and no untouched page got worse. automate-annotation.md and create-a-dataset.md have small UI-score increases, which aren't shown on the dashboard.

Needs owner sign-off

Claim Where Owning team Why unverified
Datasets show Run model > Evaluate model performance and an Evaluations page docs/train/evaluate-a-model.md:81-96, overview.md:54-56, links from custom-training-scripts.md, retrain.md Data / Machine Learning app dataset-sidebar.svelte:198,735 and evaluations/+page.svelte:15-21 show these only when ENABLE_MODEL_EVALUATION is on. data/feature_models.go:359 sets FallbackValue: false, and the rollout state is stored outside the repo.
Auto-predictions start from Run model > Get auto-predictions docs/train/automate-annotation.md:29 Data / Machine Learning The same flag controls this. With it off, dataset-sidebar.svelte:716 shows a standalone Get auto-predictions button, which is what the page said before this PR. If the flag isn't on for every org, this step is wrong for users who don't have it.

If the flag isn't fully rolled out, hold the merge until it is, or keep the old auto-predictions step and mark evaluation as limited availability.

Nits

  • docs/train/overview.md:11: updated: "2026-11-02", but this PR rewrote the page through 2026-11-06. Fix: bump it to the merge date.
Verified against source (14 claims, spot-checked on top of the PR's own verification list)
  • GetRobotPart returns (*RobotPart, string, error) and RobotConfig is map[string]interface{}: viamrobotics/rdk app/app_client.go:120,1581
  • UpdateRobotPart(ctx, id, name, robotConfig) has no last-known-update check in Go: rdk app/app_client.go:1762
  • Python update_robot_part accepts last_known_update; RobotPart exposes robot_config and last_updated: viam-python-sdk src/viam/app/app_client.py:233-241,1584-1590
  • test-local mounts the dataset root as the working directory: rdk cli/ml_training.go:1008
  • test-local passes only --dataset_file: rdk cli/ml_training.go:1124
  • Training containers are linux/x86_64 and run under Rosetta on ARM: rdk cli/ml_training.go:993-1002
  • --dataset-root, --dataset-file, --custom-args, --container-id flags: rdk cli/ml_training.go:41-45
  • --module-resource flag: rdk cli/app.go:131
  • with-upload uses --model-type and always uploads as private: rdk cli/ml_training.go:34,115
  • upload takes --type and --framework: rdk cli/ml_training.go:528-538
  • --type=unspecified: rdk cli/ml_training.go:710
  • Evaluation failure messages: app mlinference/batch_worker_common.go:61,69
  • Metric colors (green ≥85%, yellow ≥70%, red below): app evaluations/evaluation-utils.ts:9-12
  • ListDatasetsByOrganizationID anchor resolves on the data client page through dataset.md: docs/reference/apis/data-client.md:170

Automated review by Claude. Rerunning the review updates this comment.

@elizafarley
Eliza Farley (elizafarley) marked this pull request as ready for review November 6, 2026 22:20
@elizafarley
Eliza Farley (elizafarley) merged commit 53ce77d into main Nov 6, 2026
14 checks passed
@elizafarley
Eliza Farley (elizafarley) deleted the claude/local-train-model-changes-5f5427 branch November 6, 2026 22:21
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

🔎💬 Inkeep AI search and chat service is syncing content for source 'Viam Docs'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to build This pull request is marked safe to build from a trusted zone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants