junfu1115 / DANet

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

Meet some problem when i try to eval.. #51

Open forrestsz opened 5 years ago

forrestsz commented 5 years ago

Traceback (most recent call last): File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 946, in _build_extension_module check=True) File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/subprocess.py", line 438, 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 "test.py", line 16, in import encoding.utils as utils File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/init.py", line 13, in from . import nn, functions, dilated, parallel, utils, models, datasets File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/nn/init.py", line 12, in from .encoding import File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/nn/encoding.py", line 19, in from ..functions import scaledL2, aggregate, pairwise_cosine File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/functions/init.py", line 2, in from .encoding import File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/functions/encoding.py", line 14, in from .. import lib File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/init.py", line 12, in ], build_directory=cpu_path, verbose=False) File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 645, in load is_python_module) File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 814, in _jit_compile with_cuda=with_cuda) File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 863, in _write_ninja_file_and_build _build_extension_module(name, build_directory, verbose) File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 959, in _build_extension_module raise RuntimeError(message) RuntimeError: Error building extension 'enclib_cpu': b'[1/3] c++ -MMD -MF roi_align_cpu.o.d -DTORCH_EXTENSION_NAME=enclib_cpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include -isystem /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include/TH -isystem /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include/THC -isystem /home/xieke/anaconda3/envs/pt_source/include/python3.6m -fPIC -std=c++11 -c /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp -o roi_align_cpu.o\nFAILED: roi_align_cpu.o \nc++ -MMD -MF roi_align_cpu.o.d -DTORCH_EXTENSION_NAME=enclib_cpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include -isystem /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include/TH -isystem /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include/THC -isystem /home/xieke/anaconda3/envs/pt_source/include/python3.6m -fPIC -std=c++11 -c /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp -o roi_align_cpu.o\n/home/xieke/anaconda3/envs/pt_source/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)\':\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:407:30: error: \'struct at::Type\' has no member named \'tensor\'\n auto output = input.type().tensor({num_rois, channels, pooled_height, pooled_width});\n ^\nIn file included from /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include/ATen/ATen.h:9:0,\n from /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:1:\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp: In lambda function:\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:425:27: error: expected primary-expression before \'>\' token\n output.data());\n ^\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:425:29: error: expected primary-expression before \')\' token\n output.data());\n ^\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp: In lambda function:\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:425:27: error: expected primary-expression before \'>\' token\n output.data());\n ^\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:425:29: error: expected primary-expression before \')\' token\n output.data());\n ^\n/home/xieke/anaconda3/envs/pt_source/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)\':\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:454:37: error: \'struct at::Type\' has no member named \'tensor\'\n auto grad_in = bottom_rois.type().tensor({bsize, channels, height, width}).zero(); \n ^\nIn file included from /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include/ATen/ATen.h:9:0,\n from /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:1:\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp: In lambda function:\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:470:28: error: expected primary-expression before \'>\' token\n grad_in.data(),\n ^\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:470:30: error: expected primary-expression before \')\' token\n grad_in.data(),\n ^\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp: In lambda function:\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:470:28: error: expected primary-expression before \'>\' token\n grad_in.data(),\n ^\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:470:30: error: expected primary-expression before \')\' token\n grad_in.data(),\n ^\n[2/3] c++ -MMD -MF roi_align.o.d -DTORCH_EXTENSION_NAME=enclib_cpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include -isystem /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include/TH -isystem /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include/THC -isystem /home/xieke/anaconda3/envs/pt_source/include/python3.6m -fPIC -std=c++11 -c /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align.cpp -o roi_align.o\nIn file included from /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align.cpp:1:0:\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include/torch/torch.h:7:2: warning: #warning "Including torch/torch.h for C++ extensions is deprecated. Please include torch/extension.h" [-Wcpp]\n #warning \\n ^\nninja: build stopped: subcommand failed.\n' (pt_source) xieke@ubuntu:~/wuyong/codes/DANet/danet$ CUDA_VISIBLE_DEVICES=0,1,2,3 python test.py --dataset cityscapes --model danet --resume-dir cityscapes/model --base-size 2048 --crop-size 1024 --workers 1 --backbone resnet101 --multi-grid --multi-dilation 4 8 16 --eval --multi-scales Traceback (most recent call last): File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 946, in _build_extension_module check=True) File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/subprocess.py", line 438, 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 "test.py", line 16, in import encoding.utils as utils File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/init.py", line 13, in from . import nn, functions, dilated, parallel, utils, models, datasets File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/nn/init.py", line 12, in from .encoding import File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/nn/encoding.py", line 19, in from ..functions import scaledL2, aggregate, pairwise_cosine File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/functions/init.py", line 2, in from .encoding import File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/functions/encoding.py", line 14, in from .. import lib File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/init.py", line 12, in ], build_directory=cpu_path, verbose=False) File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 645, in load is_python_module) File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 814, in _jit_compile with_cuda=with_cuda) File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 863, in _write_ninja_file_and_build _build_extension_module(name, build_directory, verbose) File "/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 959, in _build_extension_module raise RuntimeError(message) RuntimeError: Error building extension 'enclib_cpu': b"[1/2] c++ -MMD -MF roi_align_cpu.o.d -DTORCH_EXTENSION_NAME=enclib_cpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include -isystem /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include/TH -isystem /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include/THC -isystem /home/xieke/anaconda3/envs/pt_source/include/python3.6m -fPIC -std=c++11 -c /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp -o roi_align_cpu.o\nFAILED: roi_align_cpu.o \nc++ -MMD -MF roi_align_cpu.o.d -DTORCH_EXTENSION_NAME=enclib_cpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include -isystem /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include/TH -isystem /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include/THC -isystem /home/xieke/anaconda3/envs/pt_source/include/python3.6m -fPIC -std=c++11 -c /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp -o roi_align_cpu.o\n/home/xieke/anaconda3/envs/pt_source/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)':\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:407:30: error: 'struct at::Type' has no member named 'tensor'\n auto output = input.type().tensor({num_rois, channels, pooled_height, pooled_width});\n ^\nIn file included from /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include/ATen/ATen.h:9:0,\n from /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:1:\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp: In lambda function:\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:425:27: error: expected primary-expression before '>' token\n output.data());\n ^\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:425:29: error: expected primary-expression before ')' token\n output.data());\n ^\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp: In lambda function:\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:425:27: error: expected primary-expression before '>' token\n output.data());\n ^\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:425:29: error: expected primary-expression before ')' token\n output.data());\n ^\n/home/xieke/anaconda3/envs/pt_source/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)':\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:454:37: error: 'struct at::Type' has no member named 'tensor'\n auto grad_in = bottom_rois.type().tensor({bsize, channels, height, width}).zero(); \n ^\nIn file included from /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/torch/lib/include/ATen/ATen.h:9:0,\n from /home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:1:\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp: In lambda function:\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:470:28: error: expected primary-expression before '>' token\n grad_in.data(),\n ^\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:470:30: error: expected primary-expression before ')' token\n grad_in.data(),\n ^\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp: In lambda function:\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:470:28: error: expected primary-expression before '>' token\n grad_in.data(),\n ^\n/home/xieke/anaconda3/envs/pt_source/lib/python3.6/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:470:30: error: expected primary-expression before ')' token\n grad_in.data(),\n ^\nninja: build stopped: subcommand failed.\n"

forrestsz commented 5 years ago

i am confused, have anyone like me? thank

emma-sjwang commented 5 years ago

@linqinghong Met same question...

forrestsz commented 5 years ago

@linqinghong Met same question... I have solve this problem, the mainly problem caused by pytorch-encoding, i suggest you to reinstall the pytorch by source, what's more, you can reference this link:https://zhuanlan.zhihu.com/p/53418563 hope it can help you ~

HolmesShuan commented 5 years ago

Try PyTorch4.1.0, e.g.,

pip install -v torch==4.1.0
Dirtybluer commented 5 years ago

@linqinghong Met same question... I have solve this problem, the mainly problem caused by pytorch-encoding, i suggest you to reinstall the pytorch by source, what's more, you can reference this link:https://zhuanlan.zhihu.com/p/53418563 hope it can help you ~

Can't understand why dose that make sense, since ninja --v is used to output the version of ninja. Hope @junfu1115 can help solve this problem.

smilliy commented 5 years ago

@linqinghong Met same question... I have solve this problem, the mainly problem caused by pytorch-encoding, i suggest you to reinstall the pytorch by source, what's more, you can reference this link:https://zhuanlan.zhihu.com/p/53418563 hope it can help you ~

Can't understand why dose that make sense, since ninja --v is used to output the version of ninja. Hope @junfu1115 can help solve this problem.

you can try "pip install encoding==" to find the correct encoding vision, and install it with whl.