Downloading trained Torch7 models (.t7) to PyTorch

I use the Torch7 library to implement neural networks. Basically, I rely on pre-prepared models. In Lua, I use the torch.load function to load a model saved as a torch.t7 file. I am interested in switching to PyTorch ( http://pytorch.org ) and I read the docs. I could not find any information on the loading mechanisms of the pre-prepared model. The only relevant information I could find is this page: http://pytorch.org/docs/torch.html

But the torch.load function described on the page loads the file saved with pickle. If anyone has more information about loading .t7 models into PyTorch, please share it here.

+4
source share
1 answer

The correct function load_lua:

from torch.utils.serialization import load_lua

x = load_lua('x.t7')
+8
source

Source: https://habr.com/ru/post/1667817/


All Articles