当前位置:网站首页>Troubleshooting the problem of pytorch geometric torch scatter and torch spark installation errors
Troubleshooting the problem of pytorch geometric torch scatter and torch spark installation errors
2022-06-30 21:37:00 【A big cat who wants to lie flat every day】
problem
In the installation torch-scatter、torch-sparse Waiting for a wrong report
Report errors subprocess.CalledProcessError: Command ‘[‘which‘, ‘g++‘]‘ returned non-zero exit status 1.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-56zzyn27/torch-sparse/setup.py", line 46, in <module>
packages=find_packages(),
File "/home/aha/anaconda3/envs/geo/lib/python3.6/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/home/aha/anaconda3/envs/geo/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/aha/anaconda3/envs/geo/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/home/aha/anaconda3/envs/geo/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/aha/anaconda3/envs/geo/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 290, in run
self.run_command('build')
File "/home/aha/anaconda3/envs/geo/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/aha/anaconda3/envs/geo/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/aha/anaconda3/envs/geo/lib/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/home/aha/anaconda3/envs/geo/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/aha/anaconda3/envs/geo/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/aha/anaconda3/envs/geo/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 79, in run
_build_ext.run(self)
File "/home/aha/anaconda3/envs/geo/lib/python3.6/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/home/aha/anaconda3/envs/geo/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 232, in build_extensions
self._check_abi()
File "/home/aha/anaconda3/envs/geo/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 370, in _check_abi
check_compiler_abi_compatibility(compiler)
File "/home/aha/anaconda3/envs/geo/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 162, in check_compiler_abi_compatibility
if not check_compiler_ok_for_platform(compiler):
File "/home/aha/anaconda3/envs/geo/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 138, in check_compiler_ok_for_platform
which = subprocess.check_output(['which', compiler], stderr=subprocess.STDOUT)
File "/home/aha/anaconda3/envs/geo/lib/python3.6/subprocess.py", line 356, in check_output
**kwargs).stdout
File "/home/aha/anaconda3/envs/geo/lib/python3.6/subprocess.py", line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['which', 'g++']' returned non-zero exit status 1.
----------------------------------------
ERROR: Failed building wheel for torch-sparse
Solution
step 1: install gcc and g++
This is because gcc and g++ No installation , You can install it with the following command
sudo apt-get install build-essential
Ubuntu By default , It didn't provide C/C++ Compiler environment for , Therefore, manual installation is also required . If installed separately gcc as well as g++ More trouble , Fortunately, , To be able to compile Ubuntu The kernel of ,Ubuntu Provides a build-essential software package .
Installation completed , Some users re execute pip Command to install scatter and sparse That's all right. , But I have a problem again .
step 2: solve torch_scatter Installation version problem
Let's start with the solution , Is to specify in the installation command torch_scatter Version of pip install torch-scatter==2.0.6 -f https://data.pyg.org/whl/torch-1.6.0+cu101.html
You can use only pip install torch-scatter==2.0.6
Let's talk about the process of solving the problem :
First, I run the following commands under the guidance of the official website :pip install -f https://data.pyg.org/whl/torch-1.6.0+cu101.html
An error has occurred , Some error reports are as follows :
csrc/scatter.cpp:135:30: error: no matching function for call to ‘at::Tensor::div_(at::Tensor&, const char [6])’
out.div_(count, "floor");
^
In file included from /opt/conda/lib/python3.7/site-packages/torch/include/ATen/Tensor.h:3:0,
from /opt/conda/lib/python3.7/site-packages/torch/include/ATen/Context.h:4,
from /opt/conda/lib/python3.7/site-packages/torch/include/ATen/ATen.h:5,
from /opt/conda/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
from /opt/conda/lib/python3.7/site-packages/torch/include/torch/script.h:3,
from csrc/scatter.cpp:2:
/opt/conda/lib/python3.7/site-packages/torch/include/ATen/core/TensorBody.h:649:12: note: candidate: at::Tensor& at::Tensor::div_(const at::Tensor&) const
Tensor & div_(const Tensor & other) const;
^~~~
/opt/conda/lib/python3.7/site-packages/torch/include/ATen/core/TensorBody.h:649:12: note: candidate expects 1 argument, 2 provided
/opt/conda/lib/python3.7/site-packages/torch/include/ATen/core/TensorBody.h:651:12: note: candidate: at::Tensor& at::Tensor::div_(c10::Scalar) const
Tensor & div_(Scalar other) const;
^~~~
/opt/conda/lib/python3.7/site-packages/torch/include/ATen/core/TensorBody.h:651:12: note: candidate expects 1 argument, 2 provided
error: command 'gcc' failed with exit status 1
Take a closer look at this command. At the beginning, the execution is :
That is, trying to install torch_scatter 2.0.9 edition .
however , When I go to the combination given on the official website , I found that my system should not use 2.0.9 edition
https://data.pyg.org/whl/
Click... In the above link torch-1.6.0+cu101
List the following torch_scatter edition 
The highest is 2.0.6 edition , according to 2.0.9 The version does not match my system , Therefore, an error is reported . As for why this happens , I don't know . But we can specify torch_scatter To solve the problem .pip install torch-scatter==2.0.6 -f https://data.pyg.org/whl/torch-1.6.0+cu101.html
Refer to the post :
https://blog.csdn.net/klarclm/article/details/8550931
https://blog.csdn.net/Iv_zzy/article/details/109310965
边栏推荐
- Ssh server configuration file parameter permitrootlogin introduction
- Ten security measures against unauthorized access attacks
- Four Misunderstandings of Internet Marketing
- ceshi deces
- Radar data processing technology
- 1-10 根据不同的url响应客户端的内容
- To the Sultanate of Anderson
- 笔记【JUC包以及Future介绍】
- Analysis and proposal on the "sour Fox" vulnerability attack weapon platform of the US National Security Agency
- 升级kube出现unknown flag: --network-plugin
猜你喜欢

Oracle 数据库表结构 Excel 导出

布隆过滤器

興奮神經遞質——穀氨酸與大腦健康

Neurotransmetteurs excitateurs - glutamate et santé cérébrale

Why have the intelligent investment advisory products collectively taken off the shelves of banks become "chicken ribs"?

ArcGIS construction and release of simple road network data service and rest call test

Dm8: generate DM AWR Report

银行集体下架的智能投顾产品,为何成了“鸡肋”?

Reading notes of Clickhouse principle analysis and Application Practice (3)

网络营销之四大误解
随机推荐
1-21 JSONP接口
Five years after graduation, I wondered if I would still be so anxious if I hadn't taken the test
[untitled]
Fletter nested hell? No, constraintlayout to save!
Spatiotemporal data mining: an overview
Side sleep ha ha ha
网络营销之四大误解
The 16th Heilongjiang Provincial Collegiate Programming Contest
What happens when word encounters an error while trying to open a file?
Et la dégradation du modèle de génération de texte? Simctg vous donne la réponse
兴奋神经递质——谷氨酸与大脑健康
PyTorch量化实践(1)
asp.net core JWT传递
Reading notes of Clickhouse principle analysis and Application Practice (2)
Prediction and regression of stacking integrated model
mysql-批量更新
Coefficient of variation method matlab code [easy to understand]
给苏丹国安德森苏丹的撒过 d s g
clickhouse原生监控项,系统表描述
Internet of things botnet gafgyt family and backdoor vulnerability exploitation of Internet of things devices