Skip to content

Low PyTorch versions

Zhengyang Feng edited this page Jan 7, 2022 · 4 revisions

Model loading

If you have lower PyTorch versions, < 1.6.0 (e.g. restricted by CUDA version), and you want to load our trained weights, you need to convert them.

First, install a CPU-only version of PyTorch 1.6, which should be possible for any machine.

Then, load and save without using zip format (which was introduced at 1.6):

import torch
PATH = 'path to the pt file'
x = torch.load(PATH, map_location='cpu')
torch.save(x, PATH[: PATH.rfind('.')] + '_converted.pt', _use_new_zipfile_serialization=False)

Mixed precision training

Regretfully, for PyTorch version lower than 1.6, we dropped the amp support, it will not be used even if you specify --mixed-precision.

Clone this wiki locally