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

Issues with running train_model.ipynb locally #281

Open
GabeTsai opened this issue Nov 29, 2024 · 7 comments
Open

Issues with running train_model.ipynb locally #281

GabeTsai opened this issue Nov 29, 2024 · 7 comments

Comments

@GabeTsai
Copy link

I'm trying to train a custom PyG model on RelBench datasets for the class CS224W and I've been using train_model.ipynb as a guideline. I've been trying to run the file locally in a Conda environment with Python 3.10.15 and still get this error when running the last cell (my groupmate @RandNMR73 has also reproduced this error locally):

ImportError: 'NeighborSampler' requires either 'pyg-lib' or 'torch-sparse'

I know that @cpondoc submitted a pull request which enabled the file to work in Colab and run locally for him but unfortunately the fix does not seem to work for us. Some help resolving this dependency issue would be really appreciated. Thank you!

@rishabh-ranjan
Copy link
Collaborator

Can you follow the instructions from pyg-lib's official page and try to install it? If you get it working, can you try to make a PR which works both locally and on conda? Thanks!

@GabeTsai
Copy link
Author

GabeTsai commented Nov 29, 2024

I believe we've already tried installing the wheels according to pyg-lib's official page, which states,

To install the wheels, simply run
pip install pyg-lib -f https://data.pyg.org/whl/torch-${TORCH}+${CUDA}.html
where
${TORCH} should be replaced by either 1.12.0, 1.13.0, 2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.4.0 or 2.5.0
${CUDA} should be replaced by either cpu, cu102, cu113, cu116, cu117, cu118, cu121, or cu124

Our installation of pyg-lib accordingly looks like this -

pip install -f pyg-lib https://data.pyg.org/whl/torch-2.4.0+cpu.html

and still throws the same error.

For more context, here is the full block of code we are running to install the dependencies (taken directly from the working Colab):

!pip install torch==2.4.0
!pip install torch-geometric torch-sparse torch-scatter torch-cluster torch-spline-conv -f https://data.pyg.org/whl/torch-2.4.0+cpu.html
!pip install pytorch_frame
!pip install relbench

@rishabh-ranjan
Copy link
Collaborator

@rusty1s can you please take a look?

@rusty1s
Copy link
Collaborator

rusty1s commented Dec 2, 2024

Can you post the log when installing pyg-lib? Does

import pyg_lib

work?

@RandNMR73
Copy link

RandNMR73 commented Dec 2, 2024 via email

@rusty1s
Copy link
Collaborator

rusty1s commented Dec 2, 2024

And the import statement? does it work?

@GabeTsai
Copy link
Author

GabeTsai commented Dec 2, 2024

Unfortunately, the import statement does not work, despite pyg_lib being installed in the conda environment. This is the error message we get below:
image

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

4 participants