In memory dataset missing target label tensor. #3081
-
I am first creating a pytorch data object (a general graph) like so:
where I then load this data object into an in-memory dataset, in another script. Part of the code below:
The
I have checked the labels before saving them into the data object, they are numeric, they seem to be fine, also the same length as |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I'm really not sure to be honest. The following works for me: import torch
from torch_geometric.data import Data
x = torch.randn(100, 128)
edge_index = torch.randint(0, 100, (2, 400), dtype=torch.long)
y = torch.randn(100)
data = Data(x=x, edge_index=edge_index, y=y)
torch.save(data, 'data.pt')
data = torch.load('data.pt')
print(data.x.shape)
print(data.edge_index.shape)
print(data.y.shape) |
Beta Was this translation helpful? Give feedback.
I'm really not sure to be honest. The following works for me: