Is there any way to skip bad item in data loader? #5616
Unanswered
yangyangdotcom
asked this question in
Q&A
Replies: 2 comments
-
I don't know what loader you are using, If you iterate dataset like cluster_data = ClusterData(train_data, num_parts=50, recursive=False,
save_dir=train_dataset.processed_dir)
train_loader = ClusterLoader(cluster_data, batch_size=1, shuffle=True,
num_workers=12)
...
for data in train_loader:
if data.x satisfy some condition:
continue
data = data.to(device)
optimizer.zero_grad()
y = batch.y[:batch.batch_size]
y_hat = model(batch.x, batch.edge_index.to(device))[:batch.batch_size] # 为什么要取前面的
loss = F.cross_entropy(y_hat, y)
loss.backward()
optimizer.step() |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think this is best handled on the |
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.
-
I have a dataset but some of the data is unusable (I do not know in prior). Is there any way to skip the unusable data? Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions