GithubHelp home page GithubHelp logo

Comments (11)

traveller59 avatar traveller59 commented on July 21, 2024 3

you need to download newest boost and unzip, then modify code:
second/core/box_np_ops.py:

load_pb11(["./cc/box_ops.cc"], current_dir / "box_ops_cc.so", current_dir, includes=["path/to/your_boost"])

second/core/non_maximum_supression/nms_cpu.py:

    load_pb11(
        ["../cc/nms/nms_kernel.cu.cc", "../cc/nms/nms.cc"],
        current_dir / "nms.so",
        current_dir,
        includes=["path/to/your_boost"],
        cuda=True)

there is no need to build boost, boost/geometry is header-only.

from second.pytorch.

traveller59 avatar traveller59 commented on July 21, 2024

fixed in 24da331.

from second.pytorch.

zwyzwy avatar zwyzwy commented on July 21, 2024

I try your update and met the other error, the output log is below:
/usr/lib64/python3.6/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
nvcc -std=c++11 -c -o ../cc/nms/nms_kernel.cu.o ../cc/nms/nms_kernel.cu.cc -I/usr/local/cuda/include -x cu -Xcompiler -fPIC -arch=sm_52 --expt-relaxed-constexpr
g++ -std=c++11 -shared -o /mnt/data-3/data/wenyong.zheng/vxlnet/second.pytorch/second/core/non_max_suppression/nms.so ../cc/nms/nms_kernel.cu.o ../cc/nms/nms.cc -I/usr/local/cuda/include -fPIC -O3 -I/home/users/wenyong.zheng/anaconda2/include/python2.7 -I/home/users/wenyong.zheng/.local/include/python2.7 -L/usr/local/cuda/lib64 -lcublas -lcudart
In file included from ../cc/nms/nms.cc:2:0:
../cc/nms/nms_cpu.h: 在函数‘std::vector rotate_non_max_suppression_cpu(pybind11::array_t, pybind11::array_t, pybind11::array_t, DType)’中:
../cc/nms/nms_cpu.h:90:13: 错误:‘polygon’不是命名空间‘boost::geometry::model’中的一个类型名
typedef bg::model::polygon<point_t> polygon_t;
^
../cc/nms/nms_cpu.h:91:5: 错误:‘polygon_t’在此作用域中尚未声明
polygon_t poly, qpoly;
^
../cc/nms/nms_cpu.h:91:15: 错误:expected ‘;’ before ‘poly’
polygon_t poly, qpoly;
^
../cc/nms/nms_cpu.h:92:17: 错误:the value of ‘polygon_t’ is not usable in a constant expression
std::vector<polygon_t> poly_inter, poly_union;
^
../cc/nms/nms_cpu.h:91:5: 附注:‘polygon_t’ was not declared ‘constexpr’
polygon_t poly, qpoly;
^
../cc/nms/nms_cpu.h:92:26: 错误:实参 1 的类型/值不匹配,在‘template<class Tp, class Alloc> class std::vector’的模板参数列表中
std::vector<polygon_t> poly_inter, poly_union;
^
../cc/nms/nms_cpu.h:92:26: 错误:需要一个类型,却给出了‘polygon_t’
../cc/nms/nms_cpu.h:92:26: 错误:模板第 2 个参数无效
../cc/nms/nms_cpu.h:92:38: 错误:invalid type in declaration before ‘,’ token
std::vector<polygon_t> poly_inter, poly_union;
^
../cc/nms/nms_cpu.h:108:28: 错误:‘poly’在此作用域中尚未声明
bg::append(poly, point_t(box_corners_r(i, 0, 0), box_corners_r(i, 0, 1)));
^
../cc/nms/nms_cpu.h:113:28: 错误:‘qpoly’在此作用域中尚未声明
bg::append(qpoly, point_t(box_corners_r(j, 0, 0), box_corners_r(j, 0, 1)));
^
../cc/nms/nms_cpu.h:133:29: 错误:对成员‘empty’的请求出现在‘poly_inter’中,而后者具有非类类型‘int’
if (!poly_inter.empty())
^
../cc/nms/nms_cpu.h:135:50: 错误:对成员‘front’的请求出现在‘poly_inter’中,而后者具有非类类型‘int’
inter_area = bg::area(poly_inter.front());
^
../cc/nms/nms_cpu.h:137:28: 错误:‘poly’在此作用域中尚未声明
bg::union
(poly, qpoly, poly_union);
^
../cc/nms/nms_cpu.h:137:34: 错误:‘qpoly’在此作用域中尚未声明
bg::union
(poly, qpoly, poly_union);
^
../cc/nms/nms_cpu.h:151:33: 错误:对成员‘empty’的请求出现在‘poly_union’中,而后者具有非类类型‘int’
if (!poly_union.empty()){ // ignore invalid box
^
../cc/nms/nms_cpu.h:152:54: 错误:对成员‘front’的请求出现在‘poly_union’中,而后者具有非类类型‘int’
union_area = bg::area(poly_union.front());
^
../cc/nms/nms_cpu.h:158:32: 错误:对成员‘clear’的请求出现在‘poly_union’中,而后者具有非类类型‘int’
poly_union.clear();
^
../cc/nms/nms_cpu.h:161:13: 错误:‘poly’在此作用域中尚未声明
poly.clear();
^
../cc/nms/nms_cpu.h:162:13: 错误:‘qpoly’在此作用域中尚未声明
qpoly.clear();
^
../cc/nms/nms_cpu.h:163:24: 错误:对成员‘clear’的请求出现在‘poly_inter’中,而后者具有非类类型‘int’
poly_inter.clear();
^
concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "/mnt/data-3/data/wenyong.zheng/vxlnet/second.pytorch/second/core/non_max_suppression/nms_cpu.py", line 10, in
from second.core.non_max_suppression.nms import (
ModuleNotFoundError: No module named 'second.core.non_max_suppression.nms'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib64/python3.6/concurrent/futures/process.py", line 175, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
File "/usr/lib64/python3.6/concurrent/futures/process.py", line 153, in _process_chunk
return [fn(*args) for args in chunk]
File "/usr/lib64/python3.6/concurrent/futures/process.py", line 153, in
return [fn(*args) for args in chunk]
File "/mnt/data-3/data/wenyong.zheng/vxlnet/second.pytorch/second/utils/buildtools/command.py", line 256, in compile_func
raise RuntimeError("compile failed with retcode", ret.returncode)
RuntimeError: ('compile failed with retcode', 1)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "create_data.py", line 9, in
from second.core import box_np_ops
File "/mnt/data-3/data/wenyong.zheng/vxlnet/second.pytorch/second/core/box_np_ops.py", line 7, in
from second.core.non_max_suppression.nms_gpu import rotate_iou_gpu_eval
File "/mnt/data-3/data/wenyong.zheng/vxlnet/second.pytorch/second/core/non_max_suppression/init.py", line 1, in
from second.core.non_max_suppression.nms_cpu import nms_jit, soft_nms_jit
File "/mnt/data-3/data/wenyong.zheng/vxlnet/second.pytorch/second/core/non_max_suppression/nms_cpu.py", line 18, in
cuda=True)
File "/mnt/data-3/data/wenyong.zheng/vxlnet/second.pytorch/second/utils/buildtools/pybind11_build.py", line 113, in load_pb11
cmds, cwd, num_workers=num_workers, compiler=compiler)
File "/mnt/data-3/data/wenyong.zheng/vxlnet/second.pytorch/second/utils/buildtools/command.py", line 278, in compile_libraries
if any([r.returncode != 0 for r in rets]):
File "/mnt/data-3/data/wenyong.zheng/vxlnet/second.pytorch/second/utils/buildtools/command.py", line 278, in
if any([r.returncode != 0 for r in rets]):
File "/usr/lib64/python3.6/concurrent/futures/process.py", line 366, in _chain_from_iterable_of_lists
for element in iterable:
File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 586, in result_iterator
yield fs.pop().result()
File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 425, in result
return self.__get_result()
File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
RuntimeError: ('compile failed with retcode', 1)

from second.pytorch.

traveller59 avatar traveller59 commented on July 21, 2024

This seems that your boost is too old (or g++?). I can't reproduce this in Ubuntu 16.04 with boost 1.58, are you using 14.04?
you can uninstall boost and install newest boost by

sudo add-apt-repository ppa:boost-latest/ppa
sudo apt-get update
sudo apt install libboost-all-dev

from second.pytorch.

zwyzwy avatar zwyzwy commented on July 21, 2024

the version of my libboost is 1.53 and the system is centOS.

from second.pytorch.

zwyzwy avatar zwyzwy commented on July 21, 2024

it seems another error as follows:
/usr/lib64/python3.6/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
nvcc -std=c++11 -c -o ../cc/nms/nms_kernel.cu.o ../cc/nms/nms_kernel.cu.cc -I/usr/local/cuda/include -x cu -Xcompiler -fPIC -arch=sm_52 --expt-relaxed-constexpr
g++ -std=c++11 -shared -o /mnt/data-3/data/wenyong.zheng/vxlnet/second.pytorch/second/core/non_max_suppression/nms.so ../cc/nms/nms_kernel.cu.o ../cc/nms/nms.cc -I/usr/local/cuda/include -fPIC -O3 -L/usr/local/cuda/lib64 -lcublas -lcudart
In file included from ../cc/nms/nms.cc:1:0:
../cc/nms/nms.h:3:31: fatal error: pybind11/pybind11.h: No such file or directory
#include <pybind11/pybind11.h>
^
compilation terminated.
concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "/mnt/data-3/data/wenyong.zheng/vxlnet/second.pytorch/second/core/non_max_suppression/nms_cpu.py", line 10, in
from second.core.non_max_suppression.nms import (
ModuleNotFoundError: No module named 'second.core.non_max_suppression.nms'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib64/python3.6/concurrent/futures/process.py", line 175, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
File "/usr/lib64/python3.6/concurrent/futures/process.py", line 153, in _process_chunk
return [fn(*args) for args in chunk]
File "/usr/lib64/python3.6/concurrent/futures/process.py", line 153, in
return [fn(*args) for args in chunk]
File "/mnt/data-3/data/wenyong.zheng/vxlnet/second.pytorch/second/utils/buildtools/command.py", line 256, in compile_func
raise RuntimeError("compile failed with retcode", ret.returncode)
RuntimeError: ('compile failed with retcode', 1)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "create_data.py", line 9, in
from second.core import box_np_ops
File "/mnt/data-3/data/wenyong.zheng/vxlnet/second.pytorch/second/core/box_np_ops.py", line 7, in
from second.core.non_max_suppression.nms_gpu import rotate_iou_gpu_eval
File "/mnt/data-3/data/wenyong.zheng/vxlnet/second.pytorch/second/core/non_max_suppression/init.py", line 1, in
from second.core.non_max_suppression.nms_cpu import nms_jit, soft_nms_jit
File "/mnt/data-3/data/wenyong.zheng/vxlnet/second.pytorch/second/core/non_max_suppression/nms_cpu.py", line 18, in
cuda=True)
File "/mnt/data-3/data/wenyong.zheng/vxlnet/second.pytorch/second/utils/buildtools/pybind11_build.py", line 113, in load_pb11
cmds, cwd, num_workers=num_workers, compiler=compiler)
File "/mnt/data-3/data/wenyong.zheng/vxlnet/second.pytorch/second/utils/buildtools/command.py", line 278, in compile_libraries
if any([r.returncode != 0 for r in rets]):
File "/mnt/data-3/data/wenyong.zheng/vxlnet/second.pytorch/second/utils/buildtools/command.py", line 278, in
if any([r.returncode != 0 for r in rets]):
File "/usr/lib64/python3.6/concurrent/futures/process.py", line 366, in _chain_from_iterable_of_lists
for element in iterable:
File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 586, in result_iterator
yield fs.pop().result()
File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 425, in result
return self.__get_result()
File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
RuntimeError: ('compile failed with retcode', 1)

from second.pytorch.

traveller59 avatar traveller59 commented on July 21, 2024

Where is your pybind11 library? run python3 -m pybind11 --includes, if you see nothing, you need to install pybind11 to python3 environment.

from second.pytorch.

zwyzwy avatar zwyzwy commented on July 21, 2024

I have no root to go "sudo apt install ..." , how can I update the libboost library?

from second.pytorch.

zwyzwy avatar zwyzwy commented on July 21, 2024

another error occurred:
/usr/lib64/python3.6/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
Traceback (most recent call last):
File "create_data.py", line 9, in
from second.core import box_np_ops
File "/mnt/data-3/data/wenyong.zheng/vxlnet/second.pytorch/second/core/box_np_ops.py", line 7, in
from second.core.non_max_suppression.nms_gpu import rotate_iou_gpu_eval
File "/mnt/data-3/data/wenyong.zheng/vxlnet/second.pytorch/second/core/non_max_suppression/init.py", line 2, in
from second.core.non_max_suppression.nms_gpu import nms_gpu, rotate_iou_gpu, rotate_nms_gpu
File "/mnt/data-3/data/wenyong.zheng/vxlnet/second.pytorch/second/core/non_max_suppression/nms_gpu.py", line 36, in
@cuda.jit('(int64, float32, float32[:, :], uint64[:])')
File "/home/users/wenyong.zheng/.local/lib/python3.6/site-packages/numba/cuda/decorators.py", line 96, in kernel_jit
kernel.bind()
File "/home/users/wenyong.zheng/.local/lib/python3.6/site-packages/numba/cuda/compiler.py", line 495, in bind
self._func.get()
File "/home/users/wenyong.zheng/.local/lib/python3.6/site-packages/numba/cuda/compiler.py", line 369, in get
cuctx = get_context()
File "/home/users/wenyong.zheng/.local/lib/python3.6/site-packages/numba/cuda/cudadrv/devices.py", line 194, in get_context
return _runtime.get_or_create_context(devnum)
File "/home/users/wenyong.zheng/.local/lib/python3.6/site-packages/numba/cuda/cudadrv/devices.py", line 162, in get_or_create_context
return self.push_context(self.gpus[devnum])
File "/home/users/wenyong.zheng/.local/lib/python3.6/site-packages/numba/cuda/cudadrv/devices.py", line 40, in getitem
return self.lst[devnum]
File "/home/users/wenyong.zheng/.local/lib/python3.6/site-packages/numba/cuda/cudadrv/devices.py", line 26, in getattr
numdev = driver.get_device_count()
File "/home/users/wenyong.zheng/.local/lib/python3.6/site-packages/numba/cuda/cudadrv/driver.py", line 334, in get_device_count
self.cuDeviceGetCount(byref(count))
File "/home/users/wenyong.zheng/.local/lib/python3.6/site-packages/numba/cuda/cudadrv/driver.py", line 272, in getattr
self.initialization_error)
numba.cuda.cudadrv.error.CudaSupportError: Error at driver init:

Possible CUDA driver libraries are found but error occurred during load:
/usr/lib/libcuda.so: wrong ELF class: ELFCLASS32

from second.pytorch.

traveller59 avatar traveller59 commented on July 21, 2024

I am not familiar with centOS, the following thing is just advises, I don't know whether they are working.
Are you using 32-bit system or using 32-bit cuda? If you are using 32-bit OS, please switch to 64bit. If you are using 32-bit cuda, consider uninstall cuda, install cuda by official .run file, or using Anaconda environment and using conda install -c anaconda cudatoolkit=x.x (8.0, 9.0, etc.) to install cuda for numba/pytorch in anaconda.

from second.pytorch.

zwyzwy avatar zwyzwy commented on July 21, 2024

After I modify the parameter "NUMBAPRO_CUDA_DRIVER" to the right path of my 64-bit libcuda.so, it works.
Thank you very much !

from second.pytorch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.