I think you now have a much better solution that is lutorpy . Unlike pytorch, you have a lua engine in python, so it’s more flexible to import any lua module and code into python, and it is easy to use and flexible. For pytorch, you only have very few ported modules that you can directly use in python.
With lutorpy you can easily and quickly convert between tensor and torch tensor.
In this case, you can write your code in python as follows:
import numpy as np import lutorpy as lua model = torch.load('PATH TO YOUR MODEL FILE')
A brief comparison between different libraries: How to download and use deep torch training models from python?
source share