The lower version of pytorch finds and installs the corresponding version of torch_geometric

1. Find the installation command on the official website

The installation commands corresponding to different versions of torch_geometric are not exactly the same, so we need to find the correct installation command for the required torch_geometric version first. Then find the corresponding version.

At present, there are only torch_geometric version correspondence and installation commands for pytorch 2.0.* and 1.13.* on the torch_geometric official website, and the pytorch version in my environment is 1.11.0. How to find the appropriate torch_geometric installation command?

Open torch_geometric official website:

Installation — pytorch_geometric documentation

In the lower left corner of the main page, there is a v: latest option, you can choose the old version of torch_geometric (in the lower right corner of the screenshot below):

Clicking on the inverted triangle will open the following page:

 Selecting a different torch_geometric version will jump to the specific version of the torch_geometric home page.

For example, if I choose torch_geometric version 2.0.0, the opening page will show the installation command selection corresponding to pytorch version 1.9 and 1.8.

 Considering that my pytorch version is 1.11, which is behind the above version, so if I open the version homepage of torch_geometric=2.1.0, I will find the installation command I need ( -c is the download source of the specified package to be installed ):

conda install pyg -c pyg

2. Specify torch_geometric version and file name installation

Through the above method, you can get the torch_geometric installation command corresponding to the specific version of torch, and run the above command directly to install torch_geometric successfully.

But in order to ensure that the installed torch_geometric version corresponds correctly to our pytorch version, you can specify the torch_geometric version and file name installation on the basis of the above command.

1. Confirm the version of pytorch and cuda installed locally

conda list | grep torch
conda list | grep cuda

For example, this machine is pytorch = 1.11.0 and cuda 11.3.1

2. Find the available torch_geometric version

According to the correct installation command obtained in the first step, search for the available torch_geometric version:

conda search pyg -c pyg

According to the python version of the machine, you can find multiple torch_geometric versions that meet the conditions, select one of them, and use the following command to install:

conda install pyg=2.0.4=py37_torch_1.11.0_cu113 -c pyg

Finish.

3. Download the whl file and install it locally

If the network speed is slow to install directly using commands, you can find the torch_geometric files corresponding to pytorch and cuda versions from this website, and then install them offline.

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

Guess you like

Origin blog.csdn.net/me_yundou/article/details/131189505