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

Error when import encoding #219

Closed
Lydia-z opened this issue Aug 13, 2019 · 2 comments · Fixed by #305
Closed

Error when import encoding #219

Lydia-z opened this issue Aug 13, 2019 · 2 comments · Fixed by #305

Comments

@Lydia-z
Copy link

Lydia-z commented Aug 13, 2019

import encoding
Traceback (most recent call last):
File "/home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 946, in _build_extension_module
check=True)
File "/home/machine-k40/anaconda3/envs/encnet/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 "", line 1, in
File "/home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/encoding/init.py", line 13, in
from . import nn, functions, parallel, utils, models, datasets, transforms
File "/home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/encoding/nn/init.py", line 12, in
from .encoding import *
File "/home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/encoding/nn/encoding.py", line 18, in
from ..functions import scaled_l2, aggregate, pairwise_cosine
File "/home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/encoding/functions/init.py", line 2, in
from .encoding import *
File "/home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/encoding/functions/encoding.py", line 14, in
from .. import lib
File "/home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/encoding/lib/init.py", line 27, in
build_directory=gpu_path, verbose=False)
File "/home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 645, in load
is_python_module)
File "/home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 814, in jit_compile
with_cuda=with_cuda)
File "/home/machine-k40/anaconda3/envs/encnet/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/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 959, in build_extension_module
raise RuntimeError(message)
RuntimeError: Error building extension 'enclib_gpu': [1/8] c++ -MMD -MF operator.o.d -DTORCH_EXTENSION_NAME=enclib_gpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/TH -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/THC -isystem /usr/local/cuda/include -isystem /home/machine-k40/anaconda3/envs/encnet/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/encoding/lib/gpu/operator.cpp -o operator.o
[2/8] /usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=enclib_gpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/TH -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/THC -isystem /usr/local/cuda/include -isystem /home/machine-k40/anaconda3/envs/encnet/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS
-D__CUDA_NO_HALF_CONVERSIONS
-D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' --expt-extended-lambda -std=c++11 -c /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/encoding/lib/gpu/encodingv2_kernel.cu -o encodingv2_kernel.cuda.o
FAILED: encodingv2_kernel.cuda.o
/usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=enclib_gpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/TH -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/THC -isystem /usr/local/cuda/include -isystem /home/machine-k40/anaconda3/envs/encnet/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' --expt-extended-lambda -std=c++11 -c /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/encoding/lib/gpu/encodingv2_kernel.cu -o encodingv2_kernel.cuda.o
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/torch/csrc/jit/argument_spec.h(59): error: static assertion failed with "ArgumentInfo is to be a POD struct"

1 error detected in the compilation of "/tmp/tmpxft_00002006_00000000-7_encodingv2_kernel.cpp1.ii".
[3/8] /usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=enclib_gpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/TH -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/THC -isystem /usr/local/cuda/include -isystem /home/machine-k40/anaconda3/envs/encnet/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' --expt-extended-lambda -std=c++11 -c /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/encoding/lib/gpu/syncbn_kernel.cu -o syncbn_kernel.cuda.o
FAILED: syncbn_kernel.cuda.o
/usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=enclib_gpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/TH -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/THC -isystem /usr/local/cuda/include -isystem /home/machine-k40/anaconda3/envs/encnet/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' --expt-extended-lambda -std=c++11 -c /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/encoding/lib/gpu/syncbn_kernel.cu -o syncbn_kernel.cuda.o
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/torch/csrc/jit/argument_spec.h(59): error: static assertion failed with "ArgumentInfo is to be a POD struct"

1 error detected in the compilation of "/tmp/tmpxft_00002007_00000000-7_syncbn_kernel.cpp1.ii".
[4/8] /usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=enclib_gpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/TH -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/THC -isystem /usr/local/cuda/include -isystem /home/machine-k40/anaconda3/envs/encnet/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' --expt-extended-lambda -std=c++11 -c /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/encoding/lib/gpu/encoding_kernel.cu -o encoding_kernel.cuda.o
FAILED: encoding_kernel.cuda.o
/usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=enclib_gpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/TH -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/THC -isystem /usr/local/cuda/include -isystem /home/machine-k40/anaconda3/envs/encnet/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' --expt-extended-lambda -std=c++11 -c /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/encoding/lib/gpu/encoding_kernel.cu -o encoding_kernel.cuda.o
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/torch/csrc/jit/argument_spec.h(59): error: static assertion failed with "ArgumentInfo is to be a POD struct"

1 error detected in the compilation of "/tmp/tmpxft_00002003_00000000-7_encoding_kernel.cpp1.ii".
[5/8] /usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=enclib_gpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/TH -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/THC -isystem /usr/local/cuda/include -isystem /home/machine-k40/anaconda3/envs/encnet/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' --expt-extended-lambda -std=c++11 -c /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/encoding/lib/gpu/roi_align_kernel.cu -o roi_align_kernel.cuda.o
FAILED: roi_align_kernel.cuda.o
/usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=enclib_gpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/TH -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/THC -isystem /usr/local/cuda/include -isystem /home/machine-k40/anaconda3/envs/encnet/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' --expt-extended-lambda -std=c++11 -c /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/encoding/lib/gpu/roi_align_kernel.cu -o roi_align_kernel.cuda.o
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/torch/csrc/jit/argument_spec.h(59): error: static assertion failed with "ArgumentInfo is to be a POD struct"

1 error detected in the compilation of "/tmp/tmpxft_00002008_00000000-7_roi_align_kernel.cpp1.ii".
[6/8] /usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=enclib_gpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/TH -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/THC -isystem /usr/local/cuda/include -isystem /home/machine-k40/anaconda3/envs/encnet/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' --expt-extended-lambda -std=c++11 -c /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/encoding/lib/gpu/nms_kernel.cu -o nms_kernel.cuda.o
FAILED: nms_kernel.cuda.o
/usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=enclib_gpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/TH -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/THC -isystem /usr/local/cuda/include -isystem /home/machine-k40/anaconda3/envs/encnet/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' --expt-extended-lambda -std=c++11 -c /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/encoding/lib/gpu/nms_kernel.cu -o nms_kernel.cuda.o
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/torch/csrc/jit/argument_spec.h(59): error: static assertion failed with "ArgumentInfo is to be a POD struct"

1 error detected in the compilation of "/tmp/tmpxft_00002009_00000000-7_nms_kernel.cpp1.ii".
[7/8] /usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=enclib_gpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/TH -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/THC -isystem /usr/local/cuda/include -isystem /home/machine-k40/anaconda3/envs/encnet/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' --expt-extended-lambda -std=c++11 -c /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/encoding/lib/gpu/activation_kernel.cu -o activation_kernel.cuda.o
FAILED: activation_kernel.cuda.o
/usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=enclib_gpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/TH -isystem /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/THC -isystem /usr/local/cuda/include -isystem /home/machine-k40/anaconda3/envs/encnet/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' --expt-extended-lambda -std=c++11 -c /home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/encoding/lib/gpu/activation_kernel.cu -o activation_kernel.cuda.o
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/home/machine-k40/anaconda3/envs/encnet/lib/python3.6/site-packages/torch/lib/include/torch/csrc/jit/argument_spec.h(59): error: static assertion failed with "ArgumentInfo is to be a POD struct"

1 error detected in the compilation of "/tmp/tmpxft_00002005_00000000-7_activation_kernel.cpp1.ii".
ninja: build stopped: subcommand failed.

@cbrockschmidt
Copy link

Try this: #161 (comment)

@zhanghang1989
Copy link
Owner

I just update the repo recently, let me know if you still have any trouble.

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

Successfully merging a pull request may close this issue.

3 participants