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

Simplified pip env setup #27

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,10 @@ Below follows instructions on how to use Neural-LAM to train and evaluate models
## Installation
Follow the steps below to create the necessary python environment.

1. Install GEOS for your system. For example with `sudo apt-get install libgeos-dev`. This is necessary for the Cartopy requirement.
2. Use python 3.9.
3. Install version 2.0.1 of PyTorch. Follow instructions on the [PyTorch webpage](https://pytorch.org/get-started/previous-versions/) for how to set this up with GPU support on your system.
4. Install required packages specified in `requirements.txt`.
5. Install PyTorch Geometric version 2.2.0. This can be done by running
```
TORCH="2.0.1"
CUDA="cu117"
1. Use python >= 3.9.
2. Install PyTorch by following instructions on the [PyTorch webpage](https://pytorch.org/get-started/previous-versions/) for how to set this up with GPU support on your system.
3. Install required packages specified in `requirements.txt`.

pip install pyg-lib==0.2.0 torch-scatter==2.1.1 torch-sparse==0.6.17 torch-cluster==1.6.1\
torch-geometric==2.3.1 -f https://pytorch-geometric.com/whl/torch-${TORCH}+${CUDA}.html
```
You will have to adjust the `CUDA` variable to match the CUDA version on your system or to run on CPU. See the [installation webpage](https://pytorch-geometric.readthedocs.io/en/latest/install/installation.html) for more information.

## Data
Datasets should be stored in a directory called `data`.
Expand Down
10 changes: 8 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
# for all
numpy>=1.24.2
wandb>=0.13.10
matplotlib>=3.7.0
scipy>=1.10.0
pytorch-lightning>=2.0.3
shapely>=2.0.1
networkx>=3.0
Cartopy>=0.22.0
Cartopy>=0.20.0
pyproj>=3.4.1
tueplots>=0.0.8
plotly>=5.15.0
torch>=2.0.1
--find-links https://data.pyg.org/whl/torch-${TORCH}.html
torch-scatter>=2.1.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sadamov I don't quite understand how this is supposed to work if CUDA isn't installed. Doesn't this method require that the TORCH environment variable is set? Or is it just that if TORCH isn't set that pip fill try to fetch a page that doesn't exist and then will default to the cpu version available on pypi?

Copy link
Collaborator Author

@sadamov sadamov May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you are right Leif, this doesn't work on CPU only on GPU. I must have gotten confused, because I always install pytorch with conda beforehand (then it works, but --find-links is then useless). Short answer, my solution sucks and we should find a working solution for the soon-to-be packaged repo. Did you already find a way to install torch with pip that is both flexible and robust enough across various machines?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see :) ok, thanks for the clarification. I will think about this a bit more and give a proposition

torch-sparse>=0.6.15
torch-cluster>=1.6.0
torch-spline-conv>=1.2.1
torch-geometric>=2.3.0
# for dev
codespell>=2.0.0
black>=21.9b0
Expand Down
Loading