Have a look at https://github.com/szagoruyko/functional-zoo/blob/master/resnet-18-export.ipynb 1.3k
hickle is actually an interface for hdf5, so the example is actually loading a hdf5 file (but using the functional interface of pytorch, but the same thing can be done for models defined using nn.Module)