6. Store new files

The final step is to store the model files generated during training as Artifacts of the Picsellia Experiment. This step is straightforward. Suppose you are saving your model in the .h5 format; you will first save it.

# ...

model.save('weights.h5', save_format='h5')

Now you just have to add a line to store this weight file in your Picsellia Experiment with

# ...

model.save('weights.h5', save_format='h5')
experiment.store(name="model-weights", trained_model_path="weights.h5", zip=True)

Here it is πŸš€πŸŽ‰

The adaptation of your training script to Picsellia is now complete!

To summarize, we have adapted the initial script to:

  • Pull all necessary data to initialize the model training (DatasetVersion, config/weights files, parameters, etc.).
  • Log metrics to the Picsellia Experiment during training through callbacks.
  • Compute and log Evaluation on a specific test set on the Picsellia Experiment.
  • Store the model files generated as artifacts on the Picsellia Experiment.

After running this training script on your infrastructure, the experiment can be considered complete and can be exported as a ModelVersion for future operations with Picsellia.

The final version of the script is available here.