擅长:python、mysql、java
<p>从PyTorch开始,1.0<code>torch.utils.serialization</code>被完全删除。因此,再也没有人可以从Lua Torch进口模型到Pythorch。相反,我建议将PyTorch 0.4.1到<code>pip</code>安装在<code>conda</code>环境中(这样您就可以在此之后删除它),并使用<a href="https://github.com/clcarwin/convert_torch_to_pytorch" rel="nofollow noreferrer">this repo</a>将Lua Torch模型转换为PyTorch模型,而不仅仅是不能用于培训的<code>torch.nn.legacy</code>模型。然后使用PyTorch 1.xx对其执行任何操作。你也可以用PyTorch来训练你的Lua火炬模型:)</p>