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
ninja: build stopped: subcommand failed. #140
Comments
That looks like PyTorch problem. |
hi, have you solved this problem ? |
Wow, I have faced with the same problem. But I have an gcc version of 5.4.0, I don't know why. |
Hello! im getting the same error when i try running model/download_models.py |
Please change |
Thanks for the quick reply. Heres the error message i get when running model/download_models.py. I will highlight the errors in bold with gcc version5.4.0: `
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! See https://gist.github.com/goldsborough/d466f43e8ffc948ff92de7486c5216d6
warnings.warn(ABI_INCOMPATIBILITY_WARNING.format(compiler)) During handling of the above exception, another exception occurred: Traceback (most recent call last): |
see my previous comment #140 (comment) |
I found that the problem is that the position of <torch/tensor.h> has been changed , it's in <torch/serialize/tensor.h> now. I changed the code and solved my prolem. |
Hi, which version of pytorch do you use?? |
Please change |
Hello, i meet the same problems, i want to know how to change the code? than you |
At first I tried what @zhanghang1989 said " Please change torch/torch.h to torch/extension.h. " .But it didn't solve my problem. I found that the error was that <torch/tensor.h> couldnot be found, so I changed all the "#include <torch/tensor.h>" in cpp files to "#include <torch/serialize/tensor.h>". Maybe the position of "tensor.h" can be different, you can change the path in your own system. Hope this will help. |
I have the same problem as yours. |
Please uninstall the torch-encoding and reinstall it following the instruction at https://hangzhang.org/PyTorch-Encoding/notes/compile.html |
Thanks for your reply! Should I reinstall the torch-encoding using Ubuntu? I didn't find the instruction for Windows10 using Anaconda |
After i installed ninja , When i run
python main.py --dataset cifar10 --model encnetdrop --widen 8 --ncodes 32 --resume model/encnet_cifar.pth.tar --eval
it shows the error:
/home/anaconda3/lib/python3.6/site-packages/torch/utils/cpp_extension.py:118: UserWarning:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Your compiler (c++) may be ABI-incompatible with PyTorch!
Please use a compiler that is ABI-compatible with GCC 4.9 and above.
See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html.
See https://gist.github.com/goldsborough/d466f43e8ffc948ff92de7486c5216d6
for instructions on how to install GCC 4.9 or higher.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
warnings.warn(ABI_INCOMPATIBILITY_WARNING.format(compiler))
Traceback (most recent call last):
File "/home/anaconda3/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/anaconda3/lib/python3.6/subprocess.py", line 336, in check_output
**kwargs).stdout
File "/home/anaconda3/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 "main.py", line 24, in
from encoding.utils import *
File "/home/anaconda3/lib/python3.6/site-packages/encoding/init.py", line 13, in
from . import nn, functions, dilated, parallel, utils, models, datasets
File "/home/anaconda3/lib/python3.6/site-packages/encoding/nn/init.py", line 12, in
from .encoding import *
File "/home/anaconda3/lib/python3.6/site-packages/encoding/nn/encoding.py", line 18, in
from ..functions import scaled_l2, aggregate, pairwise_cosine
File "/home/anaconda3/lib/python3.6/site-packages/encoding/functions/init.py", line 2, in
from .encoding import *
File "/home/anaconda3/lib/python3.6/site-packages/encoding/functions/encoding.py", line 14, in
from .. import lib
File "/home/anaconda3/lib/python3.6/site-packages/encoding/lib/init.py", line 15, in
], build_directory=cpu_path, verbose=False)
File "/home/anaconda3/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 514, in load
with_cuda=with_cuda)
File "/home/anaconda3/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 682, in _jit_compile
_build_extension_module(name, build_directory)
File "/home/anaconda3/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 765, in _build_extension_module
name, error.output.decode()))
RuntimeError: Error building extension 'enclib_cpu': [1/4] c++ -MMD -MF syncbn_cpu.o.d -DTORCH_EXTENSION_NAME=enclib_cpu -I/home/anaconda3/lib/python3.6/site-packages/torch/lib/include -I/home/anaconda3/lib/python3.6/site-packages/torch/lib/include/TH -I/home/anaconda3/lib/python3.6/site-packages/torch/lib/include/THC -I/home/anaconda3/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /home/anaconda3/lib/python3.6/site-packages/encoding/lib/cpu/syncbn_cpu.cpp -o syncbn_cpu.o
FAILED: syncbn_cpu.o
c++ -MMD -MF syncbn_cpu.o.d -DTORCH_EXTENSION_NAME=enclib_cpu -I/home/anaconda3/lib/python3.6/site-packages/torch/lib/include -I/home/anaconda3/lib/python3.6/site-packages/torch/lib/include/TH -I/home/anaconda3/lib/python3.6/site-packages/torch/lib/include/THC -I/home/anaconda3/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /home/anaconda3/lib/python3.6/site-packages/encoding/lib/cpu/syncbn_cpu.cpp -o syncbn_cpu.o
/home/anaconda3/lib/python3.6/site-packages/encoding/lib/cpu/syncbn_cpu.cpp:1:26: fatal error: torch/tensor.h: No such file or directory
compilation terminated.
[2/4] c++ -MMD -MF roi_align_cpu.o.d -DTORCH_EXTENSION_NAME=enclib_cpu -I/home/anaconda3/lib/python3.6/site-packages/torch/lib/include -I/home/anaconda3/lib/python3.6/site-packages/torch/lib/include/TH -I/home/anaconda3/lib/python3.6/site-packages/torch/lib/include/THC -I/home/anaconda3/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /home/anaconda3/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp -o roi_align_cpu.o
FAILED: roi_align_cpu.o
c++ -MMD -MF roi_align_cpu.o.d -DTORCH_EXTENSION_NAME=enclib_cpu -I/home/anaconda3/lib/python3.6/site-packages/torch/lib/include -I/home/anaconda3/lib/python3.6/site-packages/torch/lib/include/TH -I/home/anaconda3/lib/python3.6/site-packages/torch/lib/include/THC -I/home/anaconda3/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /home/anaconda3/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp -o roi_align_cpu.o
/home/anaconda3/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:1:26: fatal error: torch/tensor.h: No such file or directory
compilation terminated.
[3/4] c++ -MMD -MF nms_cpu.o.d -DTORCH_EXTENSION_NAME=enclib_cpu -I/home/anaconda3/lib/python3.6/site-packages/torch/lib/include -I/home/anaconda3/lib/python3.6/site-packages/torch/lib/include/TH -I/home/anaconda3/lib/python3.6/site-packages/torch/lib/include/THC -I/home/anaconda3/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /home/anaconda3/lib/python3.6/site-packages/encoding/lib/cpu/nms_cpu.cpp -o nms_cpu.o
FAILED: nms_cpu.o
c++ -MMD -MF nms_cpu.o.d -DTORCH_EXTENSION_NAME=enclib_cpu -I/home/anaconda3/lib/python3.6/site-packages/torch/lib/include -I/home/anaconda3/lib/python3.6/site-packages/torch/lib/include/TH -I/home/anaconda3/lib/python3.6/site-packages/torch/lib/include/THC -I/home/anaconda3/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /home/anaconda3/lib/python3.6/site-packages/encoding/lib/cpu/nms_cpu.cpp -o nms_cpu.o
/home/anaconda3/lib/python3.6/site-packages/encoding/lib/cpu/nms_cpu.cpp:1:26: fatal error: torch/tensor.h: No such file or directory
compilation terminated.
ninja: build stopped: subcommand failed.
The text was updated successfully, but these errors were encountered: