p-lambda/wilds

Installating via pip seems to miss `torch_scatter` dependency

Kaleidophon opened this issue · 6 comments

Hey,

I noticed that the installation via pip install wilds seems to miss the torch_scatter dependency that is also listed in the README. When e.g. trying to do from wilds.datasets.amazon_dataset import AmazonDataset I got

from wilds.datasets.amazon_dataset import AmazonDataset
  File "/Users/deul/Desktop/wilds/wilds/datasets/amazon_dataset.py", line 6, in <module>
    from wilds.common.utils import map_to_id_array
  File "/Users/deul/Desktop/wilds/wilds/common/utils.py", line 1, in <module>
    import torch, torch_scatter
ModuleNotFoundError: No module named 'torch_scatter'

As far as I can see, the solution should be as easy as adding torch_scatter>=2.0.5 to the install_requires attribute in setup.py. In my case, the error was resolved after installing torch_scatter separately.

Hi! Unfortunately, we aren't able to install torch_scatter automatically, as it requires specifying the correct Torch and CUDA version. We mention this in the README here:

Running pip install wilds or pip install -e . will automatically check for and install all of these requirements except for the torch-scatter and torch-geometric packages, which require a quick manual install.

Thanks for bringing this up. When it does become automatically installable, we'll update it.

Thanks for the response and sorry for missing that!

Hi @kohpangwei , I wonder what is the proper version of torch-scatter and torch-geometric for torch-1.7.0/1.8.0? It seems hard to have a consistent version.

Hmm, did running something like

pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.8.0+${CUDA}.html

work for you? (That's taken from https://github.com/rusty1s/pytorch_scatter#pytorch-180181.) This should give the latest version, which should hopefully work for you -- could you let us know if you run into problems with those (or with reproducibility in general) please?

It's strange that I find that only torch-scatter==2.0.2 works for me lol.

Oh, is that the version that's installed for you when you specify the version of torch and CUDA in the pip install torch-scatter... command above? Or did you have to manually specify it because the default version wasn't correct?