当前位置:   article > 正文

编译自定义算子出现的问题(GCFSR)--Command ‘[‘ninja‘, ‘-v‘]‘_raise calledprocesserror(retcode, process.args, su

raise calledprocesserror(retcode, process.args, subprocess.calledprocesserro

编译自定义算子遇到的问题

一、问题描述

  File "/home/jankin/miniconda3/envs/env_GCFSR/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1893, in _run_ninja_build
    subprocess.run(
  File "/home/jankin/miniconda3/envs/env_GCFSR/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

...
...(省略部分)
...

/usr/include/c++/11/bits/std_function.h:435:145: note:         ‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’:
  530 |         operator=(_Functor&& __f)
      |   
/usr/include/c++/11/bits/std_function.h:530:146: note:         ‘_ArgTypes’
ninja: build stopped: subcommand failed.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

二、问题分析

观察上述问题中发现,实际报错提示为:
subprocess.CalledProcessError: Command ‘[‘ninja’, ‘-v’]’ returned non-zero exit status 1.

三、解决方案

1、根据错误提示找到cpp_extension.py文件,提示如下:
home/jankin/miniconda3/envs/env_GCFSR/lib/python3.8/site-packages/torch/utils/cpp_extension.py

2、在 cpp_extension.py文件中,
[‘ninja’, ‘-v’] 修改为 [‘ninja’, ‘–version’]

3、重新运行,上述问题得到解决

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/506877
推荐阅读
相关标签
  

闽ICP备14008679号