Closed shyam196 closed 2 years ago
Hi! The underlying dataset file did not change, and I obtained the same error as you. This seems to be caused by the change in the collate policy of pytorch geometric (I am using torch_geometric 2.0.1).
data0.y = ['a', 'b']
data1.y = ['c', 'd', 'e']
data_list = [data0, data1]
# after collating and using the pyg dataset object, I got
dataset.data.y = [['a', 'c']]
dataset.data.slices['y'] = [tensor([0,1])]
dataset[0].y = ['a']
dataset[1].y = ['c']
# expected behavior should be
dataset.data.y = [['a', 'b'], ['c', 'd', 'e']]
dataset[0].y = ['a', 'b']
dataset[1].y = ['c', 'd', 'e']
@rusty1s Could you please help check this?
Good catch. PyG 2.0 also tries to collate elements of lists (similar to how the standard PyTorch DataLoader
handles lists), which leads to this change in outcome. I restored the original behavior in PyG for lists which hold elements such as integers and strings. As a result, you can fix this issue by installing PyG from master for now.
Awesome, thanks both!
I might have spoken too soon 🤔
I tried installing PyG from master (i.e. pip install git+...
) but I still get the same error on the code2 example. The change in behaviour mentioned by @weihua916 is now fixed when I checked in the interpreter when I installed from master, but I think something else is perhaps the source of the issue? The length of dataset.data.y
is still 1 on PyG master :-(
Ok, let me check that tomorrow:)
I checked once again and the above error is gone for me when using PyG master. Keep in mind that you need to re-process the dataset first. You can simply enforce this by removing the processed
directory in the dataset folder.
That fixed it! Thanks 🙂
If you try running the code2 example, there is an out of bounds error. It runs fine on my laptop, which has an old version of the code2 dataset downloaded several months ago. A fresh download does not seem to work.
Here's the error:
dataset.data.y has length 1, hence why the error is thrown.
Did something change in the version of the dataset uploaded?