Skip to main content
You have joined a use case and accepted the terms. There are two ways to train a model:
  • The Run tab. Click Start training on the use case page, or Run in its tab bar: it opens the Run your model panel, where you pick a model, pass its checks, configure and start, all in the dashboard. See Run Your Model.
  • The notebook. You run a Jupyter notebook to connect and upload models to the platform, with full control in code. This page walks you through it, along with the step by step notebook in the public GitHub repository.

Pull Training Notebook and Model Repositories

On your machine, pull the Quickstart GitHub repository and, inside it, the Model Zoo GitHub repository. The notebook contains all commands to connect and start training, the model zoo contains starter templates that you adapt to the use case’s parameters. The easiest way to customize models is by starting from the model zoo. Open a terminal and run the following commands:
This puts the model zoo at quickstart/model-zoo, where the notebook looks for it: the notebook’s clone cell skips the clone when the folder exists. The notebook runs from quickstart/notebooks, so model paths in the notebook start with ../model-zoo/model_zoo/.

Create a Virtual Environment

The SDK requires Python 3.11 or later (>=3.11,<3.15); Python 3.11 or 3.12 is recommended. On an older Python, no release satisfies the >=1.2.47 requirement below, so pip stops with a No matching distribution found error instead of installing anything. Create an environment named, for example, “tracebloc”. Python’s built-in venv is the lightest option; use Anaconda if you already work with conda:
Then, install requirements:

Install and Launch Jupyter Notebook

Install Jupyter into your environment:
Launch the notebook:

1. Connect to the tracebloc platform

Follow the instructions in the notebook to authenticate. Have your tracebloc user credentials ready: Log in

Getting Help

For more info about available functions and methods, call the help function:

2. Upload Model & Customize

Choose a model from the tracebloc model zoo, it is the easiest way to get started. The model zoo provides starter templates you can modify freely. Make sure the mandatory variables in your model file match the use case parameters. You can find all the necessary info from the use case description and exploratory data analysis (EDA). Alternatively, you can define your own architecture from scratch.

Model Parameters by Task

Every model file declares framework, main_class (or main_method for a function-based model), batch_size and category. Add the task-specific variables below: Text models also ship their tokenizer: put a <model>_tokenizer.json (or tokenizer.json) next to the model file, where the SDK picks it up automatically, or pass its path with user.upload_model(..., tokenizer="path/to/tokenizer.json"). The text models in the model zoo come with their tokenizer file. The SDK matches <model>_tokenizer.json by the model file’s name, so when you copy or rename a model-zoo file (for example to try another batch_size), copy and rename its tokenizer too: distilgpt2.py and distilgpt2_tokenizer.json become distilgpt2_bs4.py and distilgpt2_bs4_tokenizer.json. A text model uploaded without a tokenizer fails validation.

Example

A 3-way classification task on 224x224 images with LeNet would need the following lenet.py configuration:
The variables at the top are mandatory for the use case but the model definition is fully flexible. Open the model file from the model zoo in your editor, e.g.:
Modify the architecture however you like: add layers, change activations, swap to a different backbone entirely. The only requirement is that the mandatory variables (framework, main_class, image_size, batch_size, output_classes, category) stay consistent with the use case parameters. In case of multiple uploads, only the most recently uploaded model will be linked to the dataset.

Upload

Upload the model to the use case from your notebook:
The model zoo’s YOLO templates (yolo_v1/, yolo_v5/, yolo_v8/) are folders holding model.py and the loss.py the model trains with. Upload the .zip that sits next to each folder, not the folder’s model.py:
Many model zoo templates are pretrained models, for example distilgpt2, t5_small and vit_google. They build their architecture without the pretrained weights. The weights come in a separate <template>_weights.pkl file, which is not in the model zoo repository. Without it, the model trains from random weights. Fetch the file into the model file’s directory with user.fetch_seed_weights(), then upload with weights=True:
Object detection works the same way. These object detection templates have a seed: faster_rcnn_convnext_small, faster_rcnn_resnet_v2, faster_rcnn_swin_t, fcos_convnext_small, fcos_swin_t, retinanet_v2, ssd_vgg16 and ssdlite_mobilenet. Their seed carries the backbone only: the class head starts fresh, sized by output_classes.
For a template without pretrained weights, fetch_seed_weights raises an error saying so. The SDK matches the weights file by the model file’s name, as it does the tokenizer, so if you rename the model file, rename the weights file too: distilgpt2_bs4.py needs distilgpt2_bs4_weights.pkl. For details on model code formats, mandatory variables per framework, and pre-trained weights, see Customize Models. Navigate to the use case and copy the “Training Dataset ID” at the center of the use case pane and enter it to establish the link
You should get “Assignment successful!” and the dataset parameters.

4. Configure the experiment

Set the experiment name and configure hyperparameters.
Call get_training_plan() to check the settings before you start the training. For a detailed list of all hyperparameter options, see Hyperparameters. To train on part of the dataset, for example for a quick first run, set how many data items to use. For a dataset with class labels, give a number per class. For a dataset without class labels (for example causal language modeling or regression, where the link output shows allClasses: {'': 11983}), give one number:
For classical, non federated and non gradient descent-based machine learning algorithms like random forests, XGBoost, SVMs, logistic regression, use simplified settings:

5. Start Training

To send the model to the data owner’s secure environment and start training on the training data, run:
Go to the tracebloc website and your use case, then navigate to the “Training/Finetuning” tab you will see your experiment. Monitor the training process hover over the learning curves to check the performance at specific epochs and cycles.
If you want to run a second experiment, overwrite parameters and re-start training with training_plan.start().

Pause, Re-Start and Stop:

To pause, stop, or resume running experiments, click here: Experiment Controls Pausing a PyTorch model keeps every epoch that finished before the pause: when you resume, training continues with the next epoch. Only the progress of the epoch that was running is lost. A model built with any other framework, such as scikit-learn, lifelines or scikit-survival, keeps no progress when you pause it: resuming restarts the interrupted cycle from its start, so the epochs that cycle already ran are repeated. A pause expires after 7 days: if you neither resume nor stop a paused experiment within 7 days, any saved progress is deleted and the experiment shows that its pause expired. Resuming it then restarts the interrupted cycle from its start. Keeping finished epochs needs the data owner’s secure environment to run the release that introduced it, listed in the Changelog. On an older release, resuming restarts the interrupted cycle from its start, whatever the framework. Once stopped, an experiment cannot be rerun. Note: The compute budget is set by the use case owner. Your team shares one compute budget with no per-person limit.

When the compute budget runs out

Your team’s compute use and budget on the use case show as Compute at the top of the use case page, and in the Compute column of the Leaderboard. Hover over the column’s bar to see the share used. When your team has used its whole budget, the platform pauses the experiments your team is running, the same way as a pause you make yourself: a PyTorch model keeps every finished epoch and loses the epoch that was running. The experiment reads Resource: Your team’s compute budget for this use case is used up, so this experiment was paused. The pause covers every running experiment of your team members, on other use cases too: those read that the budget of another use case is used up. An inference run is never paused. Once your team is within 1 % of its budget, a new experiment is refused. The notebook’s training_plan.start() says You don’t have enough FLOPS to start the experiment., and the Run tab says Not enough petaflops left for this run for the same refusal. There is no warning as the budget runs low. When the estimated cost of an experiment is more than the budget left, it still starts, and training_plan.start() prints a warning that it will stop when the budget runs out. The Run tab shows the estimated cost in PF before you start. Lower the epochs or cycles, or ask for a bigger budget first. To go on after a pause:
  1. Ask the use case owner to raise the budget: see Compute budget. Peers can’t raise it themselves.
  2. Resume the experiment with its play control on the Training tab. Nothing resumes on its own when the budget is raised. While the budget is still used up, resuming is refused with You don’t have enough FLOPS to start the experiment. and the experiment stays paused.
A paused experiment’s saved progress expires after 7 days, as above.

Submit an Experiment to the Leaderboard

Once training is complete, submit your best model to the leaderboard for evaluation on the test dataset. For the full submission flow and leaderboard details, see the Evaluate Model guide.

Inviting Others to Your Team

See the Join guide for instructions.

Next Steps


Need Help?

For more info about available functions and methods, call the help function in your notebook: