fuvty / DeSCo

The official implementation of WSDM'24 paper <DeSCo: Towards Generalizable and Scalable Deep Subgraph Counting>
https://fuvty.notion.site/Paper-accepted-by-WSDM-24-385bb3245c12484495f6b448f61304a3?pvs=4
Apache License 2.0
15 stars 0 forks source link

workload.py #3

Open nldyy opened 3 weeks ago

nldyy commented 3 weeks ago

When I run main.py and get to line 301 in workload.py, an error occurs, but I haven't changed any other code. I'd like to ask for some directions on how to resolve this issue? ![Uploading 屏幕截图 2024-09-13 192601.png…]()

fuvty commented 2 weeks ago

Hi @nldyy , thank you for your question. But it seems that your screenshot was not uploaded correctly. Could you try uploading it again so that we can get a better understanding of what happened?

nldyy commented 2 weeks ago

I apologize for the initial failed upload. The first image contains the code that caused the error, and the second image shows the error report. Thank you for your response. 1 2

fuvty commented 2 weeks ago

It seems to be a problem related to the in-memory-dataset class of PyG. Which PyG version do you use? Could you try to print all attributes of self so that we can better identify the problem?

I apologize for the initial failed upload. The first image contains the code that caused the error, and the second image shows the error report. Thank you for your response. 1 2

nldyy commented 2 weeks ago

Here's the version I print:print(torch_geometric.version)-------2.5.3 Here are the attributes I understand; not sure if my comprehension is correct. This is the MUTAG/NeighborhoodDataset/processed/neighs_pyg_depth_4.pt DeSCo/data/MUTAG/NeighborhoodDataset/processed/neighs_pyg_depth_4.pt'

data = torch.load(file_path) print(data) (HeteroData( y=[3183, 1], count={ node_feature=[19944, 1], count0=[19944, 1], count-1=[19944, 1], count-2=[19944, 1], count-3=[19944, 1], count-4=[19944, 1], count-5=[19944, 1], count-6=[19944, 1], count-7=[19944, 1], count-8=[19944, 1], count-9=[19944, 1], count-10=[19944, 1], count-11=[19944, 1], count-12=[19944, 1], count-13=[19944, 1], count-14=[19944, 1], count-15=[19944, 1], count-16=[19944, 1], count-17=[19944, 1], count-18=[19944, 1], count-19=[19944, 1], count-20=[19944, 1], count-21=[19944, 1], count-22=[19944, 1], count-23=[19944, 1], count-24=[19944, 1], count-25=[19944, 1], count-26=[19944, 1], count-27=[19944, 1], count_-28=[19944, 1], }, canonical={ node_feature=[3183, 1], count0=[3183, 1], count-1=[3183, 1], count-2=[3183, 1], count-3=[3183, 1], count-4=[3183, 1], count-5=[3183, 1], count-6=[3183, 1], count-7=[3183, 1], count-8=[3183, 1], count-9=[3183, 1], count-10=[3183, 1], count-11=[3183, 1], count-12=[3183, 1], count-13=[3183, 1], count-14=[3183, 1], count-15=[3183, 1], count-16=[3183, 1], count-17=[3183, 1], count-18=[3183, 1], count-19=[3183, 1], count-20=[3183, 1], count-21=[3183, 1], count-22=[3183, 1], count-23=[3183, 1], count-24=[3183, 1], count-25=[3183, 1], count-26=[3183, 1], count-27=[3183, 1], count_-28=[3183, 1], }, (count, union, canonical)={ edge_index=[2, 3721] }, (canonical, union, count)={ edge_index=[2, 3721] }, (count, union, count)={ edge_index=[2, 35650] } ), {'y': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count': {'node_feature': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count0': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-1': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-2': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-3': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-4': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-5': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-6': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-7': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-8': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-9': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-10': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-11': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-12': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-13': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-14': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-15': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-16': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-17': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-18': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-19': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-20': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-21': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-22': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-23': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-24': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-25': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-26': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count-27': tensor([ 0, 1, 3, ..., 19931, 19937, 19944]), 'count_-28': tensor([ 0, 1, 3, ..., 19931, 19937, 19944])}, 'canonical': {'node_feature': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count0': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-1': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-2': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-3': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-4': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-5': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-6': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-7': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-8': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-9': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-10': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-11': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-12': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-13': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-14': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-15': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-16': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-17': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-18': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-19': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-20': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-21': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-22': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-23': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-24': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-25': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-26': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count-27': tensor([ 0, 1, 2, ..., 3181, 3182, 3183]), 'count_-28': tensor([ 0, 1, 2, ..., 3181, 3182, 3183])}, ('count', 'union', 'canonical'): {'edge_index': tensor([ 0, 1, 2, ..., 3719, 3720, 3721])}, ('canonical', 'union', 'count'): {'edge_index': tensor([ 0, 1, 2, ..., 3719, 3720, 3721])}, ('count', 'union', 'count'): {'edge_index': tensor([ 0, 0, 2, ..., 35628, 35638, 35650])}})

nldyy commented 2 weeks ago

data/MUTAG/NeighborhoodDataset/processed/neighs_indicator_depth_4.npy: [False True True ... True True True]

MUTAG/NeighborhoodDataset/processed/neighs_index_depth_4.npy: [[ 0 1] [ 0 2] [ 0 3] ... [187 13] [187 14] [187 15]]

data/MUTAG/NeighborhoodDataset/processed/pre_filter.pt: None

MUTAG/NeighborhoodDataset/processed/pre_transform.pt: None

nldyy commented 2 weeks ago

I printed out the files in the MUTAG/NeighborhoodDataset/processed directory, and indeed, I did not see the 'data' attribute when I checked before.Thank you for your response.

fuvty commented 2 weeks ago

The data.y should be the label for prediction. If the data attribute does not exist, could you try to simply add that attribute before assigning the value?

nldyy commented 2 weeks ago

I've noticed a peculiar situation where in the “process()” function of the “workload.py” file, executing the line “data, slices = self.collate(neighs_pyg)” and then printing “data” and “slices” does not raise any errors. However, within the “NeighborhoodDataset” class in “workload.py”, after executing “self.data, self.slices = torch.load(self.processed_paths[0])”, printing “data” results in an error, while “slices” remains consistent.

nldyy commented 2 weeks ago

I've made an interesting discovery while modifying the code in the “NeighborhoodDataset” class of “workload.py”. The first print statement for “data” outputs normally, but the second one, when accessing “self.data”, results in an error: "In 'site-packages/torch_geometric/data/in_memory_dataset.py', line 319, in __getattr__, an AttributeError is raised stating that the 'NeighborhoodDataset' object has no attribute 'data'." 3

nldyy commented 2 weeks ago

I resolved the issue by setting up the environment again. Thank you for your response and assistance.