Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can it be run on CPU? #4

Open
parisasl opened this issue Dec 4, 2022 · 9 comments
Open

Can it be run on CPU? #4

parisasl opened this issue Dec 4, 2022 · 9 comments

Comments

@parisasl
Copy link

parisasl commented Dec 4, 2022

Hi,
I've been through the installation process, and when I try to run the program with the CPU version command, it throws me an error.

I wonder if it is possible to run it with CPU only?

I'm running windows 11
Intel i7 CPU
Intel UHD Onboard graphics card (that's why I'm trying to use it with the CPU version only)
this is the command that I use (if you could verify it please):

python -m shaDow.main --configs config_train\products\vanilla\gcn_3_ppr.yml --dataset products --cpu

and this is the error I'm getting:
image_2022-12-04_01-34-20

@ZimpleX
Copy link
Contributor

ZimpleX commented Dec 4, 2022

Hi Parisa, thanks for your interest!

To run on CPU, please change the command line argument from --cpu to --gpu -1.

Please let me know if there is any other issues.

@parisasl
Copy link
Author

parisasl commented Dec 4, 2022

Thank you so much. That worked. However, I ran into a new problem, and I couldn't find a solution. I would be grateful if you could help me with it.

image

@ZimpleX
Copy link
Contributor

ZimpleX commented Dec 4, 2022

Maybe this issue is related:

https://stackoverflow.com/questions/68860621/ogb-dataset-i-can-not-import-pygnodeproppreddataset-from-ogb-nodeproppred

Could you please check if you have the packages mentioned in the above thread installed?

@parisasl
Copy link
Author

parisasl commented Dec 5, 2022

Thank you for your response. I went through the "Build and Run" section step by step, and also checked the installed packages, they are all installed. However, I still get the error.

Moreover, I tried to run another dataset (arxiv) as below:

>python -m shaDow.main --config_train\arxiv\vanilla\gcn_3_ppr.yml --dataset arxiv --gpu -1

and I got this error:

image

I'm not sure why I get these errors. Thank you for your help, in advance.

@ZimpleX
Copy link
Contributor

ZimpleX commented Dec 5, 2022

For your error on arxiv, I think you should provide the command line argument as --configs <file>.

So try this:

python -m shaDow.main --configs config_train\arxiv\vanilla\gcn_3_ppr.yml --dataset arxiv --gpu -1

I can continue looking into your issue in products once you confirm that the issue on arxiv is resolved.

@parisasl
Copy link
Author

parisasl commented Dec 5, 2022

Thank you. you were right. However, I get the same error for the arxiv dataset as well.

image

I also got another error when trying to run another dataset besides ogbn.

image

@ZimpleX
Copy link
Contributor

ZimpleX commented Dec 5, 2022

For the issue related with OGB, it should be some missing package / version mismatches for the PyG related packages. As a first step, could you please run the following in your terminal and let me know your outputs:

python -c "import torch; print(torch.__version__)"

python -c "import torch_geometric; print(torch_geometric.__version__)"

python -c "import torch_scatter; print(torch_scatter.__version__)"

python -c "import torch_sparse; print(torch_sparse.__version__)"

python -c "import ogb; print(ogb.__version__)"

For the non-ogb data like Flickr, you need to manually download the original files in the GraphSAINT repo to place them under the ./data/saint/flickr directory, as shown in the following sections of the README:

image

Can you please confirm if your ./data/saint/flickr directory contains the following files:

  • adj_full.npz
  • adj_train.npz
  • class_map.json
  • feats.npy
  • role.json

@parisasl
Copy link
Author

parisasl commented Dec 6, 2022

Thank you for your help regarding non-ogb datasets. It worked and I got the results.

For the issue related to OGB, it seems the problem is with the torch_geometric. When I run python -c "import torch_geometric; print(torch_geometric.__version__)", I get the following error. Although when I run pip install torch_geometric I get Requirement already satisfied.

image

I also run the pip install torch_tb_profiler from this link and install torch_tb_profiler. But the problem still remains.

I appreciate your help and time.

@ZimpleX
Copy link
Contributor

ZimpleX commented Dec 6, 2022

I see. It's indeed a bit tricky to install it since all related packages need to be having compatible versions.

Sometimes, I also encounter issues when I set up a new env for torch geometric. I think uninstall torch geometric (e.g., pip uninstall) and then install again may resolve the issue.

After you uninstall torch geometric, maybe you can try going through these pip install steps here: https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html#installation-via-pip-wheels

image

In the worst case, you may need to create a new virtual env and reinstall all packages from scratches (sometimes I also have to do so, unfortunately).

You may also need to reinstall ogb after reinstalling torch geometric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants