This is just a short recap
We strongly recommend completing the Mastering Valohai learning path on Valohai Academy.
This guide will provide you with a overview and a “cheatsheet” for migrating projects. It won’t explain the concepts and all the options in detail.
By default, when an execution ends it will just shut down. It will not snapshot any models or other files, unless you explictly tell Valohai to save the files.
In Valohai these files that are generated and saved during an execution are called Outputs.
When migrating a project to Valohai, you’ll need to make sure you save your models, csv files, generated images, and any other files to the Valohai Outputs.
What filetypes are supported?
Valohai doesn’t restrict you to certain file types, as long as your code understands how to save and access those files.
This means you can save for example
.tar and many other files types.
Save files to outputs
You’ll need to update your code to save to a local directory called
/valohai/outputs/ when running in Valohai.
Let’s say you had code like this:
output_path = 'model.h5' model.save(output_path)
We’d update it in Valohai to say:
output_path = '/valohai/outputs/model.h5' model.save(output_path)
Naming files & overwrites
Each job is isolated and versioned on it’s own. This means that if job #1 outputs a file called
model.h5 it will be versioned on it’s own, and when job #2 outputs a
model.h5 Valohai won’t override the first file but create a seperate file for it.
We recommend looking into the Valohai Aliases if you’re looking for friendly names for a specific version of a file:
Valohai helper library
You can also generate the output path using the Valohai Helper library.
``` python import valohai
output_path = valohai.outputs().path(“model.h5”) model.save(output_path) ```