python-torchfile icon indicating copy to clipboard operation
python-torchfile copied to clipboard

Can not read from t7

Open MabinogiX opened this issue 7 years ago • 4 comments

I have created a file in lua:

local z = torch.Tensor(3,4,5)
torch.save('tmp.t7', z)

When I read it in python, I get nothing:

import torchfile
tmp = torchfile.load('tmp.t7')
print(type(output))
print(tmp)

output:

torch.Tensor
array([], dtype=float32)

I also tried from torch.utils.serialization import load_lua but I got the same result.

I have also tried torch.save('tmp.t7', {hello=123, world=torch.rand(1,2,3)}) but got {b'hello': 123, b'world': array([], dtype=float64)}

MabinogiX avatar Jun 01 '18 08:06 MabinogiX

What is your OS, CPU architecture, and Python version?

bshillingford avatar Mar 15 '19 14:03 bshillingford

I have created a file in lua:

local z = torch.Tensor(3,4,5)
torch.save('tmp.t7', z)

When I read it in python, I get nothing:

import torchfile
tmp = torchfile.load('tmp.t7')
print(type(output))
print(tmp)

output:

torch.Tensor
array([], dtype=float32)

I also tried from torch.utils.serialization import load_lua but I got the same result.

I have also tried torch.save('tmp.t7', {hello=123, world=torch.rand(1,2,3)}) but got {b'hello': 123, b'world': array([], dtype=float64)}

FocusK avatar Nov 19 '19 08:11 FocusK

I have the same problem,can you tell me your solution?

FocusK avatar Nov 19 '19 08:11 FocusK

I'm having the same issue. Has anyone figured it out?

hayden-donnelly avatar Jun 23 '23 02:06 hayden-donnelly