【DUBUG日记】subprocess.CalledProcessError: Command ‘[‘ninja‘, ‘-v‘]‘ returned non-zero exit status 1.

Project scenario:

This is an error reported when compiling FCOS (mainly based on the maskrcnn-benchmark part).

Problem Description:

in execution

python setup.py build develop --no-deps

, a RuntimeError will be reported, and the following error will be reported:

subprocess.CalledProcessError: Command ‘[‘ninja‘, ‘-v‘]‘ returned non-zero exit status 1.

Some solutions on the Internet say to change ['ninja', '-v'] in the code to ['ninja', '–version'], but this is incorrect, and the root of the problem is not located, even if it is temporarily solved This error, there may also be errors such as g++ later.

Cause Analysis:

It can be seen from the cause of the error that it is executing

ninja -v

An error is reported. So there are several possible errors:

  1. ninja is not installed correctly ;
  2. The pytorch version is incorrect .

solution:

  1. Install ninja correctly .
pip install ninja 	#使用pip安装ninja(也可上github自行安装)
ninja --version 	#输出ninja版本,检查是否安装正确
  1. Downgrade the pytorch version . For example, my FCOS/maskrcnn-benchmark needs to reduce the pytorch version to 1.0 to solve the problem immediately.

Guess you like

Origin blog.csdn.net/lucifer479/article/details/119143734