junfu1115 / DANet

Dual Attention Network for Scene Segmentation (CVPR2019)
MIT License
2.41k stars 483 forks source link

python train.py error: ninja: build stopped: subcommand failed. #112

Open XU-GITHUB-curry opened 4 years ago

XU-GITHUB-curry commented 4 years ago

Traceback (most recent call last): File "/usr/local/anaconda3/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 960, in _build_extension_module check=True) File "/usr/local/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 "train.py", line 17, in import encoding.utils as utils File "/home/abc/.local/lib/python3.6/site-packages/encoding/init.py", line 13, in from . import nn, functions, dilated, parallel, utils, models, datasets File "/home/abc/.local/lib/python3.6/site-packages/encoding/nn/init.py", line 12, in from .encoding import File "/home/abc/.local/lib/python3.6/site-packages/encoding/nn/encoding.py", line 19, in from ..functions import scaledL2, aggregate, pairwise_cosine File "/home/abc/.local/lib/python3.6/site-packages/encoding/functions/init.py", line 2, in from .encoding import File "/home/abc/.local/lib/python3.6/site-packages/encoding/functions/encoding.py", line 14, in from .. import lib File "/home/abc/.local/lib/python3.6/site-packages/encoding/lib/init.py", line 12, in ], build_directory=cpu_path, verbose=False) File "/usr/local/anaconda3/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 658, in load is_python_module) File "/usr/local/anaconda3/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 827, in _jit_compile with_cuda=with_cuda) File "/usr/local/anaconda3/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 880, in _write_ninja_file_and_build _build_extension_module(name, build_directory, verbose) File "/usr/local/anaconda3/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 973, in _build_extension_module raise RuntimeError(message) RuntimeError: Error building extension 'enclib_cpu': [1/2] c++ -MMD -MF roi_align_cpu.o.d -DTORCH_EXTENSION_NAME=enclib_cpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /usr/local/anaconda3/lib/python3.6/site-packages/torch/include -isystem /usr/local/anaconda3/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -isystem /usr/local/anaconda3/lib/python3.6/site-packages/torch/include/TH -isystem /usr/local/anaconda3/lib/python3.6/site-packages/torch/include/THC -isystem /usr/local/anaconda3/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /home/abc/.local/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 -DTORCH_API_INCLUDE_EXTENSION_H -isystem /usr/local/anaconda3/lib/python3.6/site-packages/torch/include -isystem /usr/local/anaconda3/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -isystem /usr/local/anaconda3/lib/python3.6/site-packages/torch/include/TH -isystem /usr/local/anaconda3/lib/python3.6/site-packages/torch/include/THC -isystem /usr/local/anaconda3/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /home/abc/.local/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp -o roi_align_cpu.o /home/abc/.local/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp: In function ‘at::Tensor ROIAlignForwardCPU(const at::Tensor&, const at::Tensor&, int64_t, int64_t, double, int64_t)’: /home/abc/.local/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:407:30: error: ‘class at::DeprecatedTypeProperties’ has no member named ‘tensor’ auto output = input.type().tensor({num_rois, channels, pooled_height, pooled_width}); ^ In file included from /usr/local/anaconda3/lib/python3.6/site-packages/torch/include/ATen/ATen.h:9:0, from /home/abc/.local/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:1: /home/abc/.local/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp: In lambda function: /home/abc/.local/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:425:27: error: expected primary-expression before ‘>’ token output.data()); ^ /home/abc/.local/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:425:29: error: expected primary-expression before ‘)’ token output.data()); ^ /home/abc/.local/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp: In lambda function: /home/abc/.local/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:425:27: error: expected primary-expression before ‘>’ token output.data()); ^ /home/abc/.local/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:425:29: error: expected primary-expression before ‘)’ token output.data()); ^ /home/abc/.local/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp: In function ‘at::Tensor ROIAlignBackwardCPU(const at::Tensor&, const at::Tensor&, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, double, int64_t)’: /home/abc/.local/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:454:37: error: ‘class at::DeprecatedTypeProperties’ has no member named ‘tensor’ auto grad_in = bottom_rois.type().tensor({bsize, channels, height, width}).zero(); ^ In file included from /usr/local/anaconda3/lib/python3.6/site-packages/torch/include/ATen/ATen.h:9:0, from /home/abc/.local/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:1: /home/abc/.local/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp: In lambda function: /home/abc/.local/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:470:28: error: expected primary-expression before ‘>’ token grad_in.data(), ^ /home/abc/.local/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:470:30: error: expected primary-expression before ‘)’ token grad_in.data(), ^ /home/abc/.local/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp: In lambda function: /home/abc/.local/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:470:28: error: expected primary-expression before ‘>’ token grad_in.data(), ^ /home/abc/.local/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:470:30: error: expected primary-expression before ‘)’ token grad_in.data(), ^ ninja: build stopped: subcommand failed.

how to solve it please

theevann commented 4 years ago

See https://github.com/junfu1115/DANet/issues/113#issuecomment-647604935 of an identical issue.