Phase 7: Evaluate and iterate
This phase is optional. Phase 6 already gave you a working policy that stacks a block with no human input; here you make it measurably better. You run a batch of scored rollouts, find where the policy fails, record demonstrations aimed at those failures, retrain, and compare.
Add the episode runner
Sending start and stop by hand works for one run, but scoring ten runs that way means tracking every result yourself. The capture-control webapp’s Policy session does it for you: it starts each rollout, records it as a data sequence, and tags it with the result you give it. It needs one more service, the episode runner, from the viam-labs:capture-control-webapp module, version 0.3.0 or later.
- On the CONFIGURE tab, click + and select Blocks.
- Search for
episode-runnerand select thegeneric / capture-control:episode-runnerresult. If you didn’t add theviam-labs:capture-control-webappmodule in Phase 3, this adds it. - Name it
episode-runnerand click Add. - Paste these attributes:
{
"executor": "act-controller",
"capture_sensor": "demo-capture",
"teleop": "teleop",
"teleop_safe_takeover": false
}
executoris the controller from Phase 6. The runner sends itstartandstop, and reads itsstatusto notice when a run fails.capture_sensoris thedemo-capturesensor from Phase 3. Each rollout is captured at 10 Hz from the same cameras and components as your demonstrations, so you can watch a rollout the same way you watch an episode.teleoplets the runner stop teleop before each rollout, so the leader never drives the xArm while the policy does.teleop_safe_takeover: falseturns off the Take over key. Taking over hands the xArm back to the leader mid-run, and that’s only safe when teleop starts from the xArm’s current pose instead of jumping to the leader’s. Leave it off.
Save. The webapp’s start screen now shows a Policy session button.
Checkpoint
episode-runner service shows as ready on the CONFIGURE tab, and the webapp’s start screen offers Policy session.Choose your start positions
A score only means something if every model faces the same starts. Use the five start regions from Phase 3: center, left, right, near the arm’s base, and far from it. Pick one red and one green position in each region, and photograph or mark them, so you can set up each start again for the next model.
Measure
Run 10 rollouts, two from each start, every one the same way.
- Open the webapp and click Policy session. Use the same browser you recorded with in Phase 3, because the webapp keeps its task list in the browser.
- Under Task, select
stack the red block on the green block. - Under Checkpoint, enter the model version you deployed, for example
2026-12-02T18-32-33from the Viam app or1from the CLI. The runner tags every rollout withcheckpoint:and this value, so you can tell the models apart later. - Leave FPS at 10, and click Start session.
- Press H to home the xArm, and place the blocks at the first start.
- Press Space to start the rollout. The runner stops teleop, starts the capture, and sends
starttoact-controller. - Watch the arm, with a hand near the emergency stop. When it finishes the stack, press S for success. If it fails, press F as soon as it’s clear the run won’t recover. Either key stops the policy and ends the capture.
- Note the failure type next to the start, then repeat from step 5 for the next start.

Keep the Policy session tab visible while a rollout runs. The webapp sends the runner a heartbeat about twice a second, and the runner stops the arm if the heartbeat stops. Browsers slow down background tabs, so switching tabs can stop a run. Press Esc to stop everything and end the session.
Call a rollout a success only if the red block rests on the green block when the arm stops. For each failure, note one failure type:
- Missed grasp: the gripper closed without the block, or a finger hit the top of it.
- Dropped: the arm grasped the block, then lost it on the way.
- No release: the arm held the red block over the green one and never let go.
- Misaligned stack: the red block landed on the green block but fell off or sits crooked.
- Froze: the arm stopped moving partway through the task.
The webapp counts successes and failures for the session as you go. Your success rate is the number of successes divided by 10. Write it down: it’s the baseline for your first model.
Every rollout lands in your data as a sequence tagged source:policy, with its checkpoint: and episode: number. When you open Review session, the webapp also tags each one outcome:success or outcome:failure. On the DATA page’s SEQUENCES tab, filter by source:policy and a checkpoint: tag to see one model’s rollouts.

Without the episode runner
You can run the same trials from the DoCommand test panels instead. Before each one, send {"command": "stop"} to teleop, and home the arm with the follower-home switch (position 2). Send {"command": "start"} to act-controller, as in Phase 6, and send {"command": "stop"} when the stack is done or failed. Keep the tally yourself. Nothing records the rollouts unless you start a capture.
Find the pattern
Sort your failures by start and by type. To see why a rollout failed, open Episodes in the webapp, filter by source:policy, and play it back from both cameras.
- Failures that cluster at one start point to missing coverage: the policy hasn’t seen enough starts like that one. On the reference cell, one of the first model’s failed rollouts started with the red block near the arm’s base, a region the demonstrations rarely used.
- Failures at the grasp (missed grasps, drops) point to precision. Add demonstrations with slower, more deliberate grasps.
- No release means the policy never learned a clear moment to let go. Add demonstrations where you line the red block up over the green one, lower it until it rests there, pause, then open the gripper in one motion.
- Froze may be the gripper latency described in the Phase 6 troubleshooting table. If the arm pauses for seconds at each gripper change, more data won’t fix it.
Record targeted demonstrations
Record 15 to 20 more episodes aimed at your failure cases. For example, if both rollouts near the base failed, record several episodes that start near the base. Use the same task, stack the red block on the green block, and leave FPS at 10, so the new episodes match the old ones. Training works best when every sequence shares the same rate.
End the policy session with Esc, so only one thing drives the xArm. Then press T to start teleop. Follow Phase 3 to record, and review the new episodes the way you did in Phase 4: tag each one review:keep or discard it.
Version the dataset
Create a new dataset named xarm-stacking-v2, holding all the kept episodes from v1 plus the new keepers. Don’t overwrite or edit xarm-stacking-v1. Keeping v1 intact means you can still reproduce model version 1, and the comparison stays honest.
Use the script from Phase 4. Change the dataset name from xarm-stacking-v1 to xarm-stacking-v2, or create it in the Viam app the same way. The script keeps every demonstration tagged review:keep for the task, which now includes your new episodes. It skips the rollouts, which are tagged source:policy, so the policy never trains on its own mistakes.
Retrain
Submit the same training job as Phase 5, with two changes: select xarm-stacking-v2 (or pass its dataset ID with the CLI) and give the model a new version (for example --model-version=2 with the CLI; the app names the version for you). Keep every other argument the same, so the dataset is the only variable. Every --model-version must be new.
Compare
When the job finishes, point the policy at the new model.
- In your machine’s JSON config, change the
versionof thexarm-stackingpackage to the version your retrain produced, as in Phase 6. - Save, and wait until
act-policyreports"state": "ready"fromstatus. - Start a new policy session with the new version in the checkpoint field.
- Run the same 10 rollouts, from the same starts, and compute the success rate.
Checkpoint
Ten rollouts is a small sample, and a difference of one rollout can be noise. Look at which failure types went away, not only the total.
Other knobs
If more demonstrations don’t help, or you want to tune something else, try these settings.
- Chunk size: The
extraflags in Phase 5 set a 20-action chunk, 2 seconds at 10 Hz. A shorter chunk reacts to the cameras more often, but needs faster inference. A longer one runs longer without new camera input. Change both--policy.chunk_sizeand--policy.n_action_steps, then retrain. See How the controller paces the chunks. - Training
stepsandearly_stop_patience: Phase 5 caps the job at 20,000 steps and stops it after three evaluations without improvement. If the job ran all 20,000 steps andeval_losswas still falling, the model is underfit: raisesteps. Each 10,000 steps atbatch_size=32takes about 40 minutes on the training job’s GPUs. Raiseearly_stop_patienceif the job stops whileeval_lossis still drifting down. state_noise_stdandstate_dropout: These perturb the joint state during training, so the policy relies more on the cameras. Phase 5 setsstate_noise_std=0.2. If the policy still replays a memorized path instead of reacting to where the blocks are, raise it, or addstate_dropout=0.25.image_size: Without it, each camera trains at its own size. Set it, for example to224, to downscale the images and shorten training, at the cost of detail such as the block edges.- Fine-tune instead of starting over:
pretrained=viam:<org-id>/xarm-stacking@<model-version>starts the retrain from an earlier model version instead of from scratch. Comparisons stay fairest when every version trains from scratch, so use this when training time matters more than a clean comparison. - More demonstrations or more steps: When failures cluster by situation, more demonstrations usually beat more steps. More steps on the same data can’t teach the policy situations it never saw.
Was this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better:
Thank you!