Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 我无法在Google Colab中安装torch稀疏_Python_Pytorch - Fatal编程技术网

Python 我无法在Google Colab中安装torch稀疏

Python 我无法在Google Colab中安装torch稀疏,python,pytorch,Python,Pytorch,我正在尝试使用Google Colab安装torch sparse!pip安装,但我得到以下erorr: Collecting torch-sparse Using cached https://files.pythonhosted.org/packages/0e/bf/6242893c898621e7e4756e1ad298e903df6dfae208aec1c32adf8cfd1f7f/torch_sparse-0.4.4.tar.gz Requirement alre

我正在尝试使用Google Colab
安装torch sparse!pip安装
,但我得到以下erorr:

Collecting torch-sparse

      Using cached https://files.pythonhosted.org/packages/0e/bf/6242893c898621e7e4756e1ad298e903df6dfae208aec1c32adf8cfd1f7f/torch_sparse-0.4.4.tar.gz
    Requirement already satisfied: scipy in /usr/local/lib/python3.6/dist-packages (from torch-sparse) (1.4.1)
    Requirement already satisfied: numpy>=1.13.3 in /usr/local/lib/python3.6/dist-packages (from scipy->torch-sparse) (1.17.5)
    Building wheels for collected packages: torch-sparse
      Building wheel for torch-sparse (setup.py) ... error
      ERROR: Failed building wheel for torch-sparse
      Running setup.py clean for torch-sparse
    Failed to build torch-sparse
    Installing collected packages: torch-sparse
        Running setup.py install for torch-sparse ... error
    ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-h3_oysnr/torch-sparse/setup.py'"'"'; __file__='"'"'/tmp/pip-install-h3_oysnr/torch-sparse/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-0xvimdk5/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

如何修复它?

您需要进入运行时->更改运行时类型并选择GPU作为硬件加速器。在此之后,它应该安装良好

Collecting torch-sparse
  Downloading https://files.pythonhosted.org/packages/0e/bf/6242893c898621e7e4756e1ad298e903df6dfae208aec1c32adf8cfd1f7f/torch_sparse-0.4.4.tar.gz
Requirement already satisfied: scipy in /usr/local/lib/python3.6/dist-packages (from torch-sparse) (1.4.1)
Requirement already satisfied: numpy>=1.13.3 in /usr/local/lib/python3.6/dist-packages (from scipy->torch-sparse) (1.17.5)
Building wheels for collected packages: torch-sparse
  Building wheel for torch-sparse (setup.py) ... done
  Created wheel for torch-sparse: filename=torch_sparse-0.4.4-cp36-cp36m-linux_x86_64.whl size=4956229 sha256=0463ad1735eb37f9f555b7c83b32bd43cfee20e312061e8efca43f2c29158fbb
  Stored in directory: /root/.cache/pip/wheels/8a/1a/6f/88952b83ebba6b2742909fcd6e320e3a99fc7d2a2428391f8c
Successfully built torch-sparse
Installing collected packages: torch-sparse
Successfully installed torch-sparse-0.4.4