question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Making a custom Dataset

See original GitHub issue

❓ Questions & Help

Hello all, I am fairly new to pytorch_gemoetric and this might be a noob question. I have an numpy ndarray of shape [22, 313] and I want to represent it as a graph, with 22 nodes connected to each other correlation between channels as edge weight. Using networkx, I create the graph and weight matrices and finally- data_g = from_networkx(G) data_final = Data(x=data, edge_index=data_g.edge_index, edge_attr=data_g.weight) Is this the correct way to go… Thanks in Advance

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rusty1scommented, Jun 12, 2020

That’s correct. The easiest way to achieve that is to just pass a list of Data objects to the DataLoader (with. data.y set for each).

0reactions
srikanthmallacommented, Aug 14, 2020

Hi @rusty1s , I did that (return seperately) in get method, not __getitem__ and I got the error mentioned in the starting of the post. But when I added separate data into Data object using get method, I was not getting any error. May be should also check this __getitem__ method.

Thanks Srikanth

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating a custom Dataset and Dataloader in Pytorch - Medium
Creating a custom Dataset and Dataloader in Pytorch · The Torch Dataset class is basically an abstract class representing the dataset. · The...
Read more >
Writing Custom Datasets, DataLoaders and Transforms
torch.utils.data.Dataset is an abstract class representing a dataset. Your custom dataset should inherit Dataset and override the following methods:.
Read more >
How to Create a Custom Dataset - Dataiku Knowledge Base
Create the custom dataset¶ · Choose Dataset · Select Python as the language · Give the new dataset type an id, like raas...
Read more >
Writing custom datasets - TensorFlow
Add an entry for your dataset into DATASET_EXTRAS in setup.py . This makes it so that users can do, for example, pip install...
Read more >
Custom dataset in Pytorch —Part 1. Images | by Utkarsh Garg
Let's Code · 1. Import Libraries · 2. Define Transforms · 3. Create Train, Valid, and Test sets · 4. Create index_to_class and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found