ucbdrive / 3d-vehicle-tracking

Official implementation of Joint Monocular 3D Vehicle Detection and Tracking (ICCV 2019)
https://eborboihuc.github.io/Mono-3DT/
BSD 3-Clause "New" or "Revised" License
662 stars 134 forks source link

error with numba when running gen_dataset.py #32

Closed Txrachel closed 4 years ago

Txrachel commented 4 years ago

Hi, Thanks for your generous sharing~ when I try to run this project on Kitti-tracking-dataset, at STEP#00: python loader/gen_dataset.py kitti train met some problems with numba, it is sure that oxt_file is correctly loaded.

Traceback (most recent call last): File "loader/gen_dataset.py", line 607, in main() File "loader/gen_dataset.py", line 602, in main ds = Dataset() # load images/labels === filter valid data File "loader/gen_dataset.py", line 146, in init self.data_label = self.kitti_tracking_label() # write pkl file File "loader/gen_dataset.py", line 313, in kitti_tracking_label poses = [tu.KittiPoseParser(fields[i]) for i in range(len(fields))] File "loader/gen_dataset.py", line 313, in poses = [tu.KittiPoseParser(fields[i]) for i in range(len(fields))] File "/home/ubuntu/3d_tracking/3d-tracking/utils/tracking_utils.py", line 96, in init self.set_oxt(fields) File "/home/ubuntu/3d_tracking/3d-tracking/utils/tracking_utils.py", line 107, in set_oxt rotation = angle2rot(np.array([self.roll, self.pitch, self.yaw])) File "/home/ubuntu/3d_tracking/3d-tracking/utils/tracking_utils.py", line 113, in angle2rot return rotate(np.eye(3), rotation, inverse=inverse) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/dispatcher.py", line 349, in _compile_for_args error_rewrite(e, 'typing') File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/dispatcher.py", line 316, in error_rewrite reraise(type(e), e, None) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/six.py", line 658, in reraise raise value.with_traceback(tb) numba.errors.TypingError: Failed at nopython (nopython frontend) Internal error at <numba.typeinfer.CallConstraint object at 0x7f887fe3b240>: --%<---------------------------------------------------------------------------- Traceback (most recent call last): File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/errors.py", line 577, in new_error_context yield File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/lowering.py", line 254, in lower_block self.lower_inst(inst) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/lowering.py", line 449, in lower_assign return self.lower_expr(ty, value) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/lowering.py", line 921, in lower_expr return self.context.build_list(self.builder, resty, castvals) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/targets/cpu.py", line 110, in build_list return listobj.build_list(self, builder, list_type, items) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/targets/listobj.py", line 449, in build_list inst = ListInstance.allocate(context, builder, list_type, nitems) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/targets/listobj.py", line 317, in allocate ok, self = cls.allocate_ex(context, builder, list_type, nitems) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/targets/listobj.py", line 266, in allocate_ex self.zfill(self.size.type(0), nitems) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/targets/listobj.py", line 220, in zfill cgutils.memset(builder, base, size, ir.IntType(8)(0)) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/cgutils.py", line 847, in memset builder.call(fn, [ptr, value, size, int32_t(0), bool_t(0)]) File "/home/ubuntu/.local/lib/python3.6/site-packages/llvmlite/ir/builder.py", line 851, in call cconv=cconv, tail=tail, fastmath=fastmath) File "/home/ubuntu/.local/lib/python3.6/site-packages/llvmlite/ir/instructions.py", line 84, in init raise TypeError(msg) TypeError: Type of #4 arg mismatch: i1 != i32

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/typeinfer.py", line 142, in propagate constraint(typeinfer) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/typeinfer.py", line 423, in call self.resolve(typeinfer, typevars, fnty) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/typeinfer.py", line 450, in resolve literals=literals) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/typeinfer.py", line 1173, in resolve_call literals=literals) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/typing/context.py", line 205, in resolve_function_type return func.get_call_type_with_literals(self, args, kws, literals) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/types/abstract.py", line 268, in get_call_type_with_literals return self.get_call_type(context, args, kws) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/types/functions.py", line 255, in get_call_type template, pysig, args, kws = self.dispatcher.get_call_template(args, kws) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/dispatcher.py", line 273, in get_call_template self.compile(tuple(args)) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/dispatcher.py", line 653, in compile cres = self._compiler.compile(args, return_type) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/dispatcher.py", line 83, in compile pipeline_class=self.pipeline_class) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/compiler.py", line 873, in compile_extra return pipeline.compile_extra(func) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/compiler.py", line 367, in compile_extra return self._compile_bytecode() File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/compiler.py", line 804, in _compile_bytecode return self._compile_core() File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/compiler.py", line 791, in _compile_core res = pm.run(self.status) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/compiler.py", line 253, in run raise patched_exception File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/compiler.py", line 245, in run stage() File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/compiler.py", line 678, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/compiler.py", line 628, in _backend lowered = lowerfn() File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/compiler.py", line 615, in backend_nopython_mode self.flags) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/compiler.py", line 992, in native_lowering_stage lower.lower() File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/lowering.py", line 173, in lower self.lower_normal_function(self.fndesc) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/lowering.py", line 214, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/lowering.py", line 239, in lower_function_body self.lower_block(block) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/lowering.py", line 254, in lower_block self.lower_inst(inst) File "/home/ubuntu/anaconda3/envs/3dtracking/lib/python3.6/contextlib.py", line 99, in exit self.gen.throw(type, value, traceback) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/errors.py", line 585, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ubuntu/.local/lib/python3.6/site-packages/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed at nopython (nopython mode backend) Type of #4 arg mismatch: i1 != i32

File "utils/tracking_utils.py", line 833: def rot_axis(angle, axis):

if axis == 0:  # X
    v = [0, 4, 5, 7, 8]
    ^

[1] During: lowering "$28.6 = build_list(items=[Var($const28.1, /home/ubuntu/3d_tracking/3d-tracking/utils/tracking_utils.py (833)), Var($const28.2, /home/ubuntu/3d_tracking/3d-tracking/utils/tracking_utils.py (833)), Var($const28.3, /home/ubuntu/3d_tracking/3d-tracking/utils/tracking_utils.py (833)), Var($const28.4, /home/ubuntu/3d_tracking/3d-tracking/utils/tracking_utils.py (833)), Var($const28.5, /home/ubuntu/3d_tracking/3d-tracking/utils/tracking_utils.py (833))])" at /home/ubuntu/3d_tracking/3d-tracking/utils/tracking_utils.py (833) [2] During: resolving callee type: type(CPUDispatcher(<function rot_axis at 0x7f88828ec378>)) [3] During: typing of call at /home/ubuntu/3d_tracking/3d-tracking/utils/tracking_utils.py (862)

--%<----------------------------------------------------------------------------

File "utils/tracking_utils.py", line 862: def rotate(vector, angle, inverse=False):

# Rotation matrices around the X (gamma), Y (beta), and Z (alpha) axis
RX = rot_axis(gamma, 0)
^

This is not usually a problem with Numba itself but instead often caused by the use of unsupported features or an issue in resolving types.

To see Python/NumPy features supported by the latest release of Numba visit: http://numba.pydata.org/numba-doc/dev/reference/pysupported.html and http://numba.pydata.org/numba-doc/dev/reference/numpysupported.html

For more information about typing errors and how to debug them visit: http://numba.pydata.org/numba-doc/latest/user/troubleshoot.html#my-code-doesn-t-compile

If you think your code should work with Numba, please report the error message and traceback, along with a minimal reproducer at: https://github.com/numba/numba/issues/new


How could I solve this problem?

hoangthang1607 commented 4 years ago

downgrading llvmlite==0.24.0 works for me

Txrachel commented 4 years ago

downgrading llvmlite==0.24.0 works for me

woow, that works, thanks a lot!!