How could I save the "graph", "lib", and "params"


Through the following codes, we can get the “graph”, “lib”, and “params”:

graph, lib, params =
net, target, params=params)

I want to save these at the local PC, and then copy to the remote machine to run the model for inferrence.


You could use pickle


pickle only saves the “graph” file, but the “lib” and “params” can not be saved?


TVM Module class has a save function . check here (, so your lib can be saved in this way

Params is a dictionary and can still be saved as pickle file


:ok_man:Thanks for your suggestion.


Pickle is good to save and reload again in python. But TVM has it’s own format for params.

Refer below to save params in a format accepted by TVM runtime while deployment.


Thanks for your suggestion.