{
  "id": 101045,
  "title": "Issue using torch_sparse",
  "url": "/competitions/champs-scalar-coupling/discussion/101045",
  "author_name": "",
  "post_date": "2019-07-22T19:46:44.132246100Z",
  "votes": 1,
  "comment_count": 2,
  "views": 0,
  "content": "<p>I am getting started with GNN models and needed this <a href=\"https://github.com/rusty1s/pytorch_sparse\">library</a>. \nHowever, I am getting the following stacktrace: </p>\n\n<p>```</p>\n\n<h2>In [4]: import torch_sparse</h2>\n\n<p>ImportError                               Traceback (most recent call last)\n in ()\n----&gt; 1 import torch_sparse</p>\n\n<p>~/miniconda3/envs/deep-learning/lib/python3.6/site-packages/torch_sparse/<strong>init</strong>.py in ()\n      1 from .convert import to_torch_sparse, from_torch_sparse, to_scipy, from_scipy\n----&gt; 2 from .coalesce import coalesce\n      3 from .transpose import transpose\n      4 from .eye import eye\n      5 from .spmm import spmm</p>\n\n<p>~/miniconda3/envs/deep-learning/lib/python3.6/site-packages/torch_sparse/coalesce.py in ()\n      2 import torch_scatter\n      3 \n----&gt; 4 from .utils.unique import unique\n      5 \n      6 </p>\n\n<p>~/miniconda3/envs/deep-learning/lib/python3.6/site-packages/torch_sparse/utils/unique.py in ()\n      3 \n      4 if torch.cuda.is_available():\n----&gt; 5     import torch_sparse.unique_cuda\n      6 \n      7 </p>\n\n<p>ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory</p>\n\n<p>```</p>\n\n<p>Notice that my <code>.zshrc</code> profile contains the following declarations: </p>\n\n<p>```</p>\n\n<h1>&nbsp;Cuda specific</h1>\n\n<p>export PATH=/usr/local/cuda-10.1/bin${PATH:+:${PATH}}</p>\n\n<h1>Pytorch geometric</h1>\n\n<p>export PATH=/usr/local/cuda-10.1/bin:$PATH\nexport CUDA_HOME=/usr/local/cuda-10.1/bin\nexport CPATH=/usr/local/cuda-10.1/include:$CPATH\nexport LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64:$LD_LIBRARY_PATH\nexport DYLD_LIBRARY_PATH=/usr/local/cuda-10.1/lib:$DYLD_LIBRARY_PATH\n```</p>\n\n<p>Any helps is more than welcome. I am also happy with an alternative library if any.\nI will update this thread once I find a solution. \nMany thanks in advance. :)</p>",
  "messages": [
    {
      "id": "582136",
      "postDate": "07/22/2019 19:46:44",
      "content": "<p>I am getting started with GNN models and needed this <a href=\"https://github.com/rusty1s/pytorch_sparse\">library</a>. \nHowever, I am getting the following stacktrace: </p>\n\n<p>```</p>\n\n<h2>In [4]: import torch_sparse</h2>\n\n<p>ImportError                               Traceback (most recent call last)\n in ()\n----&gt; 1 import torch_sparse</p>\n\n<p>~/miniconda3/envs/deep-learning/lib/python3.6/site-packages/torch_sparse/<strong>init</strong>.py in ()\n      1 from .convert import to_torch_sparse, from_torch_sparse, to_scipy, from_scipy\n----&gt; 2 from .coalesce import coalesce\n      3 from .transpose import transpose\n      4 from .eye import eye\n      5 from .spmm import spmm</p>\n\n<p>~/miniconda3/envs/deep-learning/lib/python3.6/site-packages/torch_sparse/coalesce.py in ()\n      2 import torch_scatter\n      3 \n----&gt; 4 from .utils.unique import unique\n      5 \n      6 </p>\n\n<p>~/miniconda3/envs/deep-learning/lib/python3.6/site-packages/torch_sparse/utils/unique.py in ()\n      3 \n      4 if torch.cuda.is_available():\n----&gt; 5     import torch_sparse.unique_cuda\n      6 \n      7 </p>\n\n<p>ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory</p>\n\n<p>```</p>\n\n<p>Notice that my <code>.zshrc</code> profile contains the following declarations: </p>\n\n<p>```</p>\n\n<h1>&nbsp;Cuda specific</h1>\n\n<p>export PATH=/usr/local/cuda-10.1/bin${PATH:+:${PATH}}</p>\n\n<h1>Pytorch geometric</h1>\n\n<p>export PATH=/usr/local/cuda-10.1/bin:$PATH\nexport CUDA_HOME=/usr/local/cuda-10.1/bin\nexport CPATH=/usr/local/cuda-10.1/include:$CPATH\nexport LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64:$LD_LIBRARY_PATH\nexport DYLD_LIBRARY_PATH=/usr/local/cuda-10.1/lib:$DYLD_LIBRARY_PATH\n```</p>\n\n<p>Any helps is more than welcome. I am also happy with an alternative library if any.\nI will update this thread once I find a solution. \nMany thanks in advance. :)</p>",
      "rawMarkdown": "I am getting started with GNN models and needed this [library](https://github.com/rusty1s/pytorch_sparse). \nHowever, I am getting the following stacktrace: \n\n```\nIn [4]: import torch_sparse\n---------------------------------------------------------------------------\nImportError                               Traceback (most recent call last)",
      "votes": null
    },
    {
      "id": "582149",
      "postDate": "07/22/2019 20:05:44",
      "content": "<p>After some more investigation, it seems that installing the library has failed (as far as I understand) using pip. \nI will try to build the library from source. </p>",
      "rawMarkdown": "After some more investigation, it seems that installing the library has failed (as far as I understand) using pip. \nI will try to build the library from source.",
      "votes": null
    },
    {
      "id": "582156",
      "postDate": "07/22/2019 20:15:54",
      "content": "<p><strong>[SOLVED]</strong> I have re-created a conda env and reinstalled torch-sparse. \nIt appears that my <code>CUDA_HOME</code> was incorrect. The correct one is (without <code>/bin</code>&nbsp;at the end):</p>\n\n<p><code>export CUDA_HOME=/usr/local/cuda-10.1</code></p>",
      "rawMarkdown": "**[SOLVED]** I have re-created a conda env and reinstalled torch-sparse. \nIt appears that my `CUDA_HOME` was incorrect. The correct one is (without `/bin`&nbsp;at the end):\n\n`export CUDA_HOME=/usr/local/cuda-10.1`",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 582149,
      "author_name": "yassinealouini",
      "author_url": "",
      "post_date": "07/22/2019 20:05:44",
      "content": "<p>After some more investigation, it seems that installing the library has failed (as far as I understand) using pip. \nI will try to build the library from source. </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 582156,
      "author_name": "yassinealouini",
      "author_url": "",
      "post_date": "07/22/2019 20:15:54",
      "content": "<p><strong>[SOLVED]</strong> I have re-created a conda env and reinstalled torch-sparse. \nIt appears that my <code>CUDA_HOME</code> was incorrect. The correct one is (without <code>/bin</code>&nbsp;at the end):</p>\n\n<p><code>export CUDA_HOME=/usr/local/cuda-10.1</code></p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "582136": "I am getting started with GNN models and needed this [library](https://github.com/rusty1s/pytorch_sparse). \nHowever, I am getting the following stacktrace: \n\n```\nIn [4]: import torch_sparse\n---------------------------------------------------------------------------\nImportError                               Traceback (most recent call last)",
    "582149": "After some more investigation, it seems that installing the library has failed (as far as I understand) using pip. \nI will try to build the library from source.",
    "582156": "**[SOLVED]** I have re-created a conda env and reinstalled torch-sparse. \nIt appears that my `CUDA_HOME` was incorrect. The correct one is (without `/bin`&nbsp;at the end):\n\n`export CUDA_HOME=/usr/local/cuda-10.1`"
  },
  "source": "meta"
}