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:
- ninja is not installed correctly ;
- The pytorch version is incorrect .
solution:
- Install ninja correctly .
pip install ninja #使用pip安装ninja(也可上github自行安装)
ninja --version #输出ninja版本,检查是否安装正确
- Downgrade the pytorch version . For example, my FCOS/maskrcnn-benchmark needs to reduce the pytorch version to 1.0 to solve the problem immediately.