pip
:
torch > 2.0.0
),
some of our future SDK features will require it as we’ll start using many of
the new PyTorch 2.0 APIs / IRs such as .compile()
.nn.Module
that we
eventually want to export and upload to the dashboard.
First, let’s import everything we’ll need in the later steps:
Cellulose
decorator and come back to CelluloseContext
in a later section.
Decorate the SuperResolutionNet
module with the Cellulose
decorator, then
provide the input_names
and output_names
arguments:
torch_model
,
call load_state_dict
and set it to eval mode:
CelluloseContext
and pass in a personal API key. You can
read more on how to create / retrieve your API keys
here.
torch_model
module and the input tensor to
CelluloseContext
’s export()
method like below:
Uploaded PyTorch model in the model list
Graph of uploaded PyTorch model
flush
method that conveniently packs all the generated
ONNX outputs in a zip file.
generated_artifacts.cellulose.zip
folder
in the “current” directory.
Here are the contents once it is unzipped: