Creating “.t7” torch file in python
up vote
0
down vote
favorite
By using pytorch, I can manage to save file like the following:
torch.save(object, "object.t7")
However, I cannot open it through Lua.
When I use the following command in Lua,
local info1 = torch.load("object.t7")
I receive the following error:
/home/hasan/build/torch/install/bin/luajit:
...an/build/torch/install/share/lua/5.1/threads/threads.lua:315:
...an/build/torch/install/share/lua/5.1/threads/threads.lua:183:
[thread 4 callback]
...e/hasan/build/torch/install/share/lua/5.1/torch/File.lua:375:
unknown object stack traceback: [C]: in function 'error'
...e/hasan/build/torch/install/share/lua/5.1/torch/File.lua:375: in
function 'readObject'
...e/hasan/build/torch/install/share/lua/5.1/torch/File.lua:409: in
function 'load'
/home/hasan/GAN/icml2016/data/donkey_folder_txt_coco.lua:112: in
function
[C]: in function 'xpcall'
...an/build/torch/install/share/lua/5.1/threads/threads.lua:234: in
function 'callback'
...asan/build/torch/install/share/lua/5.1/threads/queue.lua:65: in
function
<...asan/build/torch/install/share/lua/5.1/threads/queue.lua:41> [C]:
in function 'pcall'
...asan/build/torch/install/share/lua/5.1/threads/queue.lua:40: in
function 'dojob' [string " local Queue = require
'threads.queue'..."]:15: in main chunk
I need to run a torch training in Lua, with preprocessed data through Pytorch.
Is there any way to save ".t7" file via pytorch, and open it through Lua?
Thanks,
python lua pytorch torch
add a comment |
up vote
0
down vote
favorite
By using pytorch, I can manage to save file like the following:
torch.save(object, "object.t7")
However, I cannot open it through Lua.
When I use the following command in Lua,
local info1 = torch.load("object.t7")
I receive the following error:
/home/hasan/build/torch/install/bin/luajit:
...an/build/torch/install/share/lua/5.1/threads/threads.lua:315:
...an/build/torch/install/share/lua/5.1/threads/threads.lua:183:
[thread 4 callback]
...e/hasan/build/torch/install/share/lua/5.1/torch/File.lua:375:
unknown object stack traceback: [C]: in function 'error'
...e/hasan/build/torch/install/share/lua/5.1/torch/File.lua:375: in
function 'readObject'
...e/hasan/build/torch/install/share/lua/5.1/torch/File.lua:409: in
function 'load'
/home/hasan/GAN/icml2016/data/donkey_folder_txt_coco.lua:112: in
function
[C]: in function 'xpcall'
...an/build/torch/install/share/lua/5.1/threads/threads.lua:234: in
function 'callback'
...asan/build/torch/install/share/lua/5.1/threads/queue.lua:65: in
function
<...asan/build/torch/install/share/lua/5.1/threads/queue.lua:41> [C]:
in function 'pcall'
...asan/build/torch/install/share/lua/5.1/threads/queue.lua:40: in
function 'dojob' [string " local Queue = require
'threads.queue'..."]:15: in main chunk
I need to run a torch training in Lua, with preprocessed data through Pytorch.
Is there any way to save ".t7" file via pytorch, and open it through Lua?
Thanks,
python lua pytorch torch
1
I'm not familia with Lua. But I guess the problem here is that PyTorch doesn't has it's own implementation for saving and loading the files. If you take a look at the source oftorch.save
you see that it's just one line relying on pythonspickle
module (`cPickle for Python2). So you probably need to look for a way opening pickled files in Lua. Alternatively you could just try another way of saving and loading without pickle.
– blue-phoenox
Nov 8 at 9:10
1
I think did not point out the main problem really well:pickle
is just an other python module. So Lua Torch has probably a completely different implementation for saving files and loading files, not based onpickle
.
– blue-phoenox
Nov 8 at 12:16
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
By using pytorch, I can manage to save file like the following:
torch.save(object, "object.t7")
However, I cannot open it through Lua.
When I use the following command in Lua,
local info1 = torch.load("object.t7")
I receive the following error:
/home/hasan/build/torch/install/bin/luajit:
...an/build/torch/install/share/lua/5.1/threads/threads.lua:315:
...an/build/torch/install/share/lua/5.1/threads/threads.lua:183:
[thread 4 callback]
...e/hasan/build/torch/install/share/lua/5.1/torch/File.lua:375:
unknown object stack traceback: [C]: in function 'error'
...e/hasan/build/torch/install/share/lua/5.1/torch/File.lua:375: in
function 'readObject'
...e/hasan/build/torch/install/share/lua/5.1/torch/File.lua:409: in
function 'load'
/home/hasan/GAN/icml2016/data/donkey_folder_txt_coco.lua:112: in
function
[C]: in function 'xpcall'
...an/build/torch/install/share/lua/5.1/threads/threads.lua:234: in
function 'callback'
...asan/build/torch/install/share/lua/5.1/threads/queue.lua:65: in
function
<...asan/build/torch/install/share/lua/5.1/threads/queue.lua:41> [C]:
in function 'pcall'
...asan/build/torch/install/share/lua/5.1/threads/queue.lua:40: in
function 'dojob' [string " local Queue = require
'threads.queue'..."]:15: in main chunk
I need to run a torch training in Lua, with preprocessed data through Pytorch.
Is there any way to save ".t7" file via pytorch, and open it through Lua?
Thanks,
python lua pytorch torch
By using pytorch, I can manage to save file like the following:
torch.save(object, "object.t7")
However, I cannot open it through Lua.
When I use the following command in Lua,
local info1 = torch.load("object.t7")
I receive the following error:
/home/hasan/build/torch/install/bin/luajit:
...an/build/torch/install/share/lua/5.1/threads/threads.lua:315:
...an/build/torch/install/share/lua/5.1/threads/threads.lua:183:
[thread 4 callback]
...e/hasan/build/torch/install/share/lua/5.1/torch/File.lua:375:
unknown object stack traceback: [C]: in function 'error'
...e/hasan/build/torch/install/share/lua/5.1/torch/File.lua:375: in
function 'readObject'
...e/hasan/build/torch/install/share/lua/5.1/torch/File.lua:409: in
function 'load'
/home/hasan/GAN/icml2016/data/donkey_folder_txt_coco.lua:112: in
function
[C]: in function 'xpcall'
...an/build/torch/install/share/lua/5.1/threads/threads.lua:234: in
function 'callback'
...asan/build/torch/install/share/lua/5.1/threads/queue.lua:65: in
function
<...asan/build/torch/install/share/lua/5.1/threads/queue.lua:41> [C]:
in function 'pcall'
...asan/build/torch/install/share/lua/5.1/threads/queue.lua:40: in
function 'dojob' [string " local Queue = require
'threads.queue'..."]:15: in main chunk
I need to run a torch training in Lua, with preprocessed data through Pytorch.
Is there any way to save ".t7" file via pytorch, and open it through Lua?
Thanks,
python lua pytorch torch
python lua pytorch torch
edited Nov 8 at 8:41
asked Nov 8 at 8:32
yusuf
1,13711245
1,13711245
1
I'm not familia with Lua. But I guess the problem here is that PyTorch doesn't has it's own implementation for saving and loading the files. If you take a look at the source oftorch.save
you see that it's just one line relying on pythonspickle
module (`cPickle for Python2). So you probably need to look for a way opening pickled files in Lua. Alternatively you could just try another way of saving and loading without pickle.
– blue-phoenox
Nov 8 at 9:10
1
I think did not point out the main problem really well:pickle
is just an other python module. So Lua Torch has probably a completely different implementation for saving files and loading files, not based onpickle
.
– blue-phoenox
Nov 8 at 12:16
add a comment |
1
I'm not familia with Lua. But I guess the problem here is that PyTorch doesn't has it's own implementation for saving and loading the files. If you take a look at the source oftorch.save
you see that it's just one line relying on pythonspickle
module (`cPickle for Python2). So you probably need to look for a way opening pickled files in Lua. Alternatively you could just try another way of saving and loading without pickle.
– blue-phoenox
Nov 8 at 9:10
1
I think did not point out the main problem really well:pickle
is just an other python module. So Lua Torch has probably a completely different implementation for saving files and loading files, not based onpickle
.
– blue-phoenox
Nov 8 at 12:16
1
1
I'm not familia with Lua. But I guess the problem here is that PyTorch doesn't has it's own implementation for saving and loading the files. If you take a look at the source of
torch.save
you see that it's just one line relying on pythons pickle
module (`cPickle for Python2). So you probably need to look for a way opening pickled files in Lua. Alternatively you could just try another way of saving and loading without pickle.– blue-phoenox
Nov 8 at 9:10
I'm not familia with Lua. But I guess the problem here is that PyTorch doesn't has it's own implementation for saving and loading the files. If you take a look at the source of
torch.save
you see that it's just one line relying on pythons pickle
module (`cPickle for Python2). So you probably need to look for a way opening pickled files in Lua. Alternatively you could just try another way of saving and loading without pickle.– blue-phoenox
Nov 8 at 9:10
1
1
I think did not point out the main problem really well:
pickle
is just an other python module. So Lua Torch has probably a completely different implementation for saving files and loading files, not based on pickle
.– blue-phoenox
Nov 8 at 12:16
I think did not point out the main problem really well:
pickle
is just an other python module. So Lua Torch has probably a completely different implementation for saving files and loading files, not based on pickle
.– blue-phoenox
Nov 8 at 12:16
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53203986%2fcreating-t7-torch-file-in-python%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
I'm not familia with Lua. But I guess the problem here is that PyTorch doesn't has it's own implementation for saving and loading the files. If you take a look at the source of
torch.save
you see that it's just one line relying on pythonspickle
module (`cPickle for Python2). So you probably need to look for a way opening pickled files in Lua. Alternatively you could just try another way of saving and loading without pickle.– blue-phoenox
Nov 8 at 9:10
1
I think did not point out the main problem really well:
pickle
is just an other python module. So Lua Torch has probably a completely different implementation for saving files and loading files, not based onpickle
.– blue-phoenox
Nov 8 at 12:16