Open The-Gupta opened 6 years ago
@tastyminerals, could you help me with this?
torch.load
works with torch models, they have .t7
extension. You are loading a .dat
file. This does not look like a torch model.
@mdtux89 is correct. Yep, only now noticed, you are using python. This is a Torch repo not PyTorch. These are two separate frameworks, Torch uses Lua, PyTorch uses Python. You need to convert this model to PyTorch first. Please read this: https://discuss.pytorch.org/t/convert-import-torch-model-to-pytorch/37/2 and this: https://github.com/clcarwin/convert_torch_to_pytorch
It is a Lua Torch model, not pytorch
require 'dp' require 'optim' require 'nngraph' xp = torch.load(r"D:/SDS/1_MachineLearning/amr-eager-master/LDC2015E86/labels.dat")
Loads with LuaJIT on Linux.
@mdtux89, okay, now I know I can't use this model directly in Python. I had visited the links suggested by @tastyminerals, but could not understand how to convert the model. Could you convert or suggest how to?
https://discuss.pytorch.org/t/convert-import-torch-model-to-pytorch/37/2 I am out of office and as I said before via email I am not able to provide you with support on this at the moment
`import torch import torch.autograd import torch.nn import torch.multiprocessing import torch.utils import torch.legacy.nn import torch.legacy.optim
xp = torch.load(r"D:\SDS\1_MachineLearning\amr-eager-master\LDC2015E86\reentrancies.dat")`
Traceback (most recent call last):
File "", line 9, in
xp = torch.load(r"D:\SDS\1_MachineLearning\amr-eager-master\LDC2015E86\reentrancies.dat")
File "D:\Anaconda3\envs\amr-eager\lib\site-packages\torch\serialization.py", line 261, in load return _load(f, map_location, pickle_module)
File "D:\Anaconda3\envs\amr-eager\lib\site-packages\torch\serialization.py", line 399, in _load magic_number = pickle_module.load(f)
UnpicklingError: invalid load key, ''.
reentrancies.dat model weights could be downloaded from here. What should I change?