News from this site

 Rental advertising space, please contact the webmaster if you need cooperation


+focus
focused

classification  

no classification

tag  

no tag

date  

no datas

torch相关版本对应依赖(23年最新)

posted on 2023-06-06 12:06     read(967)     comment(0)     like(14)     collect(3)


torch, torch-scatter, torch-sparse version dependency problem

"ModuleNotFoundError: No module named 'torch_scatter'" appears when running the program

  1. It cannot be downloaded directly, and it is prone to dependency mismatch. You need to download the corresponding dependent version, first query the cuda version

Enter nvcc -V in the linux command line (in your own virtual environment) to view the corresponding cuda version

My cuda version is 11.6. If you have not downloaded the torch library, you can visit the official website to download the required version: Previous PyTorch Versions | PyTorch

(Since I have downloaded the torch library, torch==1.13.1)

  1. Download the corresponding version of torch_scatter

Open https://pytorch-geometric.com/whl/

You can see many versions of torch and cuda combination, find the corresponding torch and cuda version

Torch-1.13.1+cu116 version has corresponding torch_cluster, torch_scatter, torch_sparse, torch_spline_conv four dependent libraries, pt113 represents the corresponding torch version, cp37 represents the corresponding python version is 3.7, there are linux and windows versions

  1. Install the .whl file

First switch to the directory where the downloaded whl file is located, and enter on the command line:

 pip install torch_scatter-2.1.0+pt113cu116-cp37-cp37m-linux_x86_64.whl

So far, congratulations, you have solved a problem



Category of website: technical article > Blog

Author:Fiee

link:http://www.pythonblackhole.com/blog/article/80641/ada0a209d97efc775346/

source:python black hole net

Please indicate the source for any form of reprinting. If any infringement is discovered, it will be held legally responsible.

14 0
collect article
collected

Comment content: (supports up to 255 characters)