Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not read from t7 #15

Open
Angel-Jia opened this issue Jun 1, 2018 · 4 comments
Open

Can not read from t7 #15

Angel-Jia opened this issue Jun 1, 2018 · 4 comments

Comments

@Angel-Jia
Copy link

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)}

@bshillingford
Copy link
Owner

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

@FocusK
Copy link

FocusK commented Nov 19, 2019

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
Copy link

FocusK commented Nov 19, 2019

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

@hayden-donnelly
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants