Trying to assign y
to dataset
#9083
Unanswered
anthonysirico
asked this question in
Q&A
Replies: 3 comments
-
UPDATE: I checked and rechecked the code using |
Beta Was this translation helpful? Give feedback.
0 replies
-
UPDATE: It would not take the |
Beta Was this translation helpful? Give feedback.
0 replies
-
Mh, does that have to do something with import torch
from torch_geometric.data import Data, InMemoryDataset
class TMSDataset(InMemoryDataset):
def __init__(self, root):
super().__init__(root)
self.load(self.processed_paths[0])
def processed_file_names(self):
return 'data.pt'
def process(self):
graphs = []
for _ in range(10):
pyg = Data()
pyg.y = torch.randn(1, 10)
graphs.append(pyg)
torch.save(self.collate(graphs), self.processed_paths[0])
dataset = TMSDataset('./data')
print(dataset.data.y)
print(dataset[0].y) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Here is the code:
But when I create the dataset,
dataset.data.y
anddataset[I].y
is no where to be found. What am I doing wrong?Beta Was this translation helpful? Give feedback.
All reactions