peterlipan / ASD_GP_GCN

ASD diagnosis on ABIDE I
MIT License
40 stars 9 forks source link

error #2

Closed GuangtaoLyu closed 2 years ago

GuangtaoLyu commented 2 years ago

Traceback (most recent call last): File "/download_ABIDE.py", line 83, in brain_graph(logs, atlas, os.path.join(args.root, 'ABIDE', 'raw'), path) File "/construct_graph.py", line 107, in brain_graph cols = list(pd.read_csv(file_path, sep='\t').columns.values) UnboundLocalError: local variable 'file_path' referenced before assignment

peterlipan commented 2 years ago

Hi! This variable is assigned by the previous step, i.e., 'Node Attributes' in function brain_graph. You can check whether it runs normally. Anyway, this part is to check if the downloaded data files have the same columns, and you can safely delete this checking part (line 106 to 111) as I have already done so. Or, you can assign variable 'file_path' to an arbitrary file's path, e.g., file_path=os.path.join(data_folder, files[0]), before the line 107 in brain_graph. Thanks!

GuangtaoLyu commented 2 years ago

thank you. I will try it.

---Original--- From: "Li @.> Date: Wed, Mar 2, 2022 22:41 PM To: @.>; Cc: @.**@.>; Subject: Re: [jhonP-Li/ASD_GP_GCN] error (Issue #2)

Hi! This variable is assigned by the previous step, i.e., 'Node Attributes' in function brain_graph. You can check whether it runs normally. Anyway, this part is to check if the downloaded data files have the same columns, and you can safely delete this checking part (line 106 to 111) as I have already done so. Or, you can assign variable 'file_path' to an arbitrary file's path, e.g., file_path=os.path.join(data_folder, files[0]), before the line 107 in brain_graph. Thanks!

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

GuangtaoLyu commented 2 years ago

thank you. I will try it. ---Original--- From: "Li @.> Date: Wed, Mar 2, 2022 22:41 PM To: @.>; Cc: @.**@.>; Subject: Re: [jhonP-Li/ASD_GP_GCN] error (Issue #2) Hi! This variable is assigned by the previous step, i.e., 'Node Attributes' in function brain_graph. You can check whether it runs normally. Anyway, this part is to check if the downloaded data files have the same columns, and you can safely delete this checking part (line 106 to 111) as I have already done so. Or, you can assign variable 'file_path' to an arbitrary file's path, e.g., file_path=os.path.join(data_folder, files[0]), before the line 107 in brain_graph. Thanks! — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

I comment out the this checking part (line 106 to 111) . And run download_ABIDE.py. When i run main.py, there is a new error. Traceback (most recent call last): File "/home/xxx/PycharmProjects/xxx/main.py", line 33, in graph_pooling(args) File "/home/xxx/PycharmProjects/xxx/training.py", line 28, in graph_pooling abide_dataset = TUDataset(args.data_dir, name='ABIDE', use_node_attr=True) File "/home/xxx/anaconda3/envs/xxx/lib/python3.7/site-packages/torch_geometric/datasets/tu_dataset.py", line 69, in init super().init(root, transform, pre_transform, pre_filter) File "/home/xxx/anaconda3/envs/xxx/lib/python3.7/site-packages/torch_geometric/data/in_memory_dataset.py", line 57, in init super().init(root, transform, pre_transform, pre_filter) File "/home/xxx/anaconda3/envs/xxx/lib/python3.7/site-packages/torch_geometric/data/dataset.py", line 88, in init self._process() File "/home/xxx/anaconda3/envs/xxx/lib/python3.7/site-packages/torch_geometric/data/dataset.py", line 171, in _process self.process() File "/home/xxx/anaconda3/envs/xxx/lib/python3.7/site-packages/torch_geometric/datasets/tu_dataset.py", line 138, in process self.data, self.slices = read_tu_data(self.raw_dir, self.name) File "/home/xxx/anaconda3/envs/xxx/lib/python3.7/site-packages/torch_geometric/io/tu.py", line 37, in read_tu_data x = cat([node_attributes, node_labels]) File "/home/xxx/anaconda3/envs/xxx/lib/python3.7/site-packages/torch_geometric/io/tu.py", line 78, in cat return torch.cat(seq, dim=-1) if len(seq) > 0 else None RuntimeError: Sizes of tensors must match except in dimension 1. Got 0 and 96681 in dimension 0 (The offending index is 1)

GuangtaoLyu commented 2 years ago

Hi! This variable is assigned by the previous step, i.e., 'Node Attributes' in function brain_graph. You can check whether it runs normally. Anyway, this part is to check if the downloaded data files have the same columns, and you can safely delete this checking part (line 106 to 111) as I have already done so. Or, you can assign variable 'file_path' to an arbitrary file's path, e.g., file_path=os.path.join(data_folder, files[0]), before the line 107 in brain_graph. Thanks!

After downloading, the raw data (i.e. fMRI) will be deleted. And the raw data still exits. The processed folder is empty.

peterlipan commented 2 years ago

This is weird. I just rerun it, and the data (brain graph) is successfully saved to './data/ABIDE/raw'. Has this folder been created in your case?

GuangtaoLyu commented 2 years ago

This is weird. I just rerun it, and the data (brain graph) is successfully saved to './data/ABIDE/raw'. Has this folder been created in your case?

yes, there are five files. ABIDE_graph_labels and ABIDE_node_attributes are empty. others are not

peterlipan commented 2 years ago

Hi! I have cloned this repository but cannot reproduce your case. The files of attributes and labels are not empty. If you still have not fixed it, please provide more information about your modifications to our code. Thanks!

GuangtaoLyu commented 2 years ago

Hi! I have cloned this repository but cannot reproduce your case. The files of attributes and labels are not empty. If you still have not fixed it, please provide more information about your modifications to our code. Thanks!

this is because i can't download the abide successfully. i have the same problem with others' repo. and i haven't solved the problem. thank you.

peterlipan commented 2 years ago

OK. The ABIDE preprocessed dataset is available at: https://s3.amazonaws.com/fcp-indi/data/Projects/ABIDE_Initiative. You can look at function fetch_abide_pcp of nilearn (https://nilearn.github.io/modules/generated/nilearn.datasets.fetch_abide_pcp.html), or you can directly download the dataset through the URL by some tools like Cyberduck. If these also do not work, maybe you need a VPN. Good luck!

GuangtaoLyu commented 2 years ago

thank you

---Original--- From: "Li @.> Date: Sat, Mar 5, 2022 22:32 PM To: @.>; Cc: @.>;"State @.>; Subject: Re: [jhonP-Li/ASD_GP_GCN] error (Issue #2)

OK. The ABIDE preprocessed dataset is available at: https://s3.amazonaws.com/fcp-indi/data/Projects/ABIDE_Initiative. You can look at function fetch_abide_pcp of nilearn (https://nilearn.github.io/modules/generated/nilearn.datasets.fetch_abide_pcp.html), or you can directly download the dataset through the URL by some tools like Cyberduck. If these also dose not work, maybe you need a VPN. Good luck!

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you modified the open/close state.Message ID: @.***>