Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run the code, ninja error #7

Closed
Smoltbob opened this issue May 10, 2019 · 4 comments
Closed

Cannot run the code, ninja error #7

Smoltbob opened this issue May 10, 2019 · 4 comments

Comments

@Smoltbob
Copy link

I followed your instructions and when running tools/test.py the following error is thrown :

File "/home/travail/jules/anaconda3/envs/HRNet/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 759, in _build_extension_module
    ['ninja', '-v'], stderr=subprocess.STDOUT, cwd=build_directory)
  File "/home/travail/jules/anaconda3/envs/HRNet/lib/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/home/travail/jules/anaconda3/envs/HRNet/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

Do you have more details on how to run your code ?
Thanks

@Smoltbob
Copy link
Author

Smoltbob commented May 10, 2019

Fixed the issue by installing ninja 1.8.2

@BanaBear
Copy link

BanaBear commented May 28, 2019

Fixed the issue by installing ninja 1.8.2

hi, i changed ninja from 1.9.0 to 1.8.2 but the problem still exists, and my env is pytorch==0.4.1, gcc==5.4.0, and beside this problem, i met another problem of ninja as following:
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/iceman/anaconda3/envs/hrnet/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 759, in _build_extension_module
['ninja', '-v'], stderr=subprocess.STDOUT, cwd=build_directory)
File "/home/iceman/anaconda3/envs/hrnet/lib/python3.6/subprocess.py", line 336, in check_output
**kwargs).stdout
File "/home/iceman/anaconda3/envs/hrnet/lib/python3.6/subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "tools/test.py", line 25, in
import models
File "/home/iceman/Desktop/github/HRNet-Semantic-Segmentation/tools/../lib/models/init.py", line 11, in
import models.seg_hrnet
File "/home/iceman/Desktop/github/HRNet-Semantic-Segmentation/tools/../lib/models/seg_hrnet.py", line 22, in
from .sync_bn.inplace_abn.bn import InPlaceABNSync
File "/home/iceman/Desktop/github/HRNet-Semantic-Segmentation/tools/../lib/models/sync_bn/init.py", line 1, in
from .inplace_abn import bn
File "/home/iceman/Desktop/github/HRNet-Semantic-Segmentation/tools/../lib/models/sync_bn/inplace_abn/init.py", line 1, in
from .bn import ABN, InPlaceABN, InPlaceABNSync
File "/home/iceman/Desktop/github/HRNet-Semantic-Segmentation/tools/../lib/models/sync_bn/inplace_abn/bn.py", line 14, in
from functions import *
File "/home/iceman/Desktop/github/HRNet-Semantic-Segmentation/lib/models/sync_bn/inplace_abn/functions.py", line 16, in
extra_cuda_cflags=["--expt-extended-lambda"])
File "/home/iceman/anaconda3/envs/hrnet/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 514, in load
with_cuda=with_cuda)
File "/home/iceman/anaconda3/envs/hrnet/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 682, in _jit_compile
_build_extension_module(name, build_directory)
File "/home/iceman/anaconda3/envs/hrnet/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 765, in _build_extension_module
name, error.output.decode()))
RuntimeError: Error building extension 'inplace_abn': ninja: warning: bad deps log signature or version; starting over
[1/4] :/usr/local/cuda-9.0/bin/nvcc -DTORCH_EXTENSION_NAME=inplace_abn -I/home/iceman/anaconda3/envs/hrnet/lib/python3.6/site-packages/torch/lib/include -I/home/iceman/anaconda3/envs/hrnet/lib/python3.6/site-packages/torch/lib/include/TH -I/home/iceman/anaconda3/envs/hrnet/lib/python3.6/site-packages/torch/lib/include/THC -I:/usr/local/cuda-9.0/include -I/home/iceman/anaconda3/envs/hrnet/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 --compiler-options '-fPIC' --expt-extended-lambda -std=c++11 -c /home/iceman/Desktop/github/HRNet-Semantic-Segmentation/lib/models/sync_bn/inplace_abn/src/inplace_abn_cuda.cu -o inplace_abn_cuda.cuda.o
FAILED: inplace_abn_cuda.cuda.o
:/usr/local/cuda-9.0/bin/nvcc -DTORCH_EXTENSION_NAME=inplace_abn -I/home/iceman/anaconda3/envs/hrnet/lib/python3.6/site-packages/torch/lib/include -I/home/iceman/anaconda3/envs/hrnet/lib/python3.6/site-packages/torch/lib/include/TH -I/home/iceman/anaconda3/envs/hrnet/lib/python3.6/site-packages/torch/lib/include/THC -I:/usr/local/cuda-9.0/include -I/home/iceman/anaconda3/envs/hrnet/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 --compiler-options '-fPIC' --expt-extended-lambda -std=c++11 -c /home/iceman/Desktop/github/HRNet-Semantic-Segmentation/lib/models/sync_bn/inplace_abn/src/inplace_abn_cuda.cu -o inplace_abn_cuda.cuda.o
/bin/sh: 1: :/usr/local/cuda-9.0/bin/nvcc: not found
[2/4] c++ -MMD -MF inplace_abn_cpu.o.d -DTORCH_EXTENSION_NAME=inplace_abn -I/home/iceman/anaconda3/envs/hrnet/lib/python3.6/site-packages/torch/lib/include -I/home/iceman/anaconda3/envs/hrnet/lib/python3.6/site-packages/torch/lib/include/TH -I/home/iceman/anaconda3/envs/hrnet/lib/python3.6/site-packages/torch/lib/include/THC -I:/usr/local/cuda-9.0/include -I/home/iceman/anaconda3/envs/hrnet/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -O3 -c /home/iceman/Desktop/github/HRNet-Semantic-Segmentation/lib/models/sync_bn/inplace_abn/src/inplace_abn_cpu.cpp -o inplace_abn_cpu.o
/home/iceman/Desktop/github/HRNet-Semantic-Segmentation/lib/models/sync_bn/inplace_abn/src/inplace_abn_cpu.cpp: In function ‘std::vectorat::Tensor backward_cpu(at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, bool, float)’:
/home/iceman/Desktop/github/HRNet-Semantic-Segmentation/lib/models/sync_bn/inplace_abn/src/inplace_abn_cpu.cpp:82:41: warning: ‘at::Tensor at::empty(const at::Type&, at::IntList)’ is deprecated [-Wdeprecated-declarations]
auto dweight = at::empty(z.type(), {0});
^
In file included from /home/iceman/anaconda3/envs/hrnet/lib/python3.6/site-packages/torch/lib/include/ATen/ATen.h:14:0,
from /home/iceman/Desktop/github/HRNet-Semantic-Segmentation/lib/models/sync_bn/inplace_abn/src/inplace_abn_cpu.cpp:1:
/home/iceman/anaconda3/envs/hrnet/lib/python3.6/site-packages/torch/lib/include/ATen/Functions.h:3521:22: note: declared here
static inline Tensor empty(const Type & dtype, IntList size) {
^
/home/iceman/Desktop/github/HRNet-Semantic-Segmentation/lib/models/sync_bn/inplace_abn/src/inplace_abn_cpu.cpp:83:39: warning: ‘at::Tensor at::empty(const at::Type&, at::IntList)’ is deprecated [-Wdeprecated-declarations]
auto dbias = at::empty(z.type(), {0});
^
In file included from /home/iceman/anaconda3/envs/hrnet/lib/python3.6/site-packages/torch/lib/include/ATen/ATen.h:14:0,
from /home/iceman/Desktop/github/HRNet-Semantic-Segmentation/lib/models/sync_bn/inplace_abn/src/inplace_abn_cpu.cpp:1:
/home/iceman/anaconda3/envs/hrnet/lib/python3.6/site-packages/torch/lib/include/ATen/Functions.h:3521:22: note: declared here
static inline Tensor empty(const Type & dtype, IntList size) {
^
[3/4] c++ -MMD -MF inplace_abn.o.d -DTORCH_EXTENSION_NAME=inplace_abn -I/home/iceman/anaconda3/envs/hrnet/lib/python3.6/site-packages/torch/lib/include -I/home/iceman/anaconda3/envs/hrnet/lib/python3.6/site-packages/torch/lib/include/TH -I/home/iceman/anaconda3/envs/hrnet/lib/python3.6/site-packages/torch/lib/include/THC -I:/usr/local/cuda-9.0/include -I/home/iceman/anaconda3/envs/hrnet/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -O3 -c /home/iceman/Desktop/github/HRNet-Semantic-Segmentation/lib/models/sync_bn/inplace_abn/src/inplace_abn.cpp -o inplace_abn.o
ninja: build stopped: subcommand failed.

@sunformoon
Copy link

@BanaBear Encountered the exactly same error. Would you have a chance to fix it?

@dzyjjpy
Copy link

dzyjjpy commented Feb 27, 2020

@sunformoon @BanaBear do you solve the issue? I have the same one
#104
My environment:
I tried pytorch 1.0, 1.1, 1.2 on branch-1.1
my environment:
ubuntu:16.04
python:3.6
gcc: 5.4
cuda: 10.0

and I install re2c and ninja by source code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants