Cannot find DGL C++ sparse library at /home/lzw/anaconda3/envs/occwl_1/lib/python3.9/site-packages/dgl/dgl_sparse/

I want to use the module dgl.sparse to create a transformer-based model, but meet this error.
I seek many information about this, but can’t find one solution suitable for me.


dgl: 1.1.2
python version: 3.9.16
CUDA version: 12.2
pytorch version: 2.1.0

I need your help, thanks!

DGL with pytorch 2.1 is not supported yet. The title indicates you’re using pytorch 1.9 and dgl_sparse is not supported on this version(1.9 is too old).

To pick up the latest DGL release which supports dgl_sparse, please upgrade pytorch to 1.13 or 2.0 and install DGL by referring to Deep Graph Library. If you want to work with CUDA 12.x and pytorch 2.1, you need to build DGL from source on your own. See instructions here.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.