analysiscenter / radio

RadIO is a library for data science research of computed tomography imaging
https://analysiscenter.github.io/radio/
Apache License 2.0
222 stars 52 forks source link

Numda errors #11

Closed lindehesse closed 6 years ago

lindehesse commented 6 years ago

I am not very familiar with git yet but this issue is an continuation of llvmlite, numba errors #7, which was closed.

I have the same error as Screenium encountered the first time. @AlexeyKozhevin I changed the function def get_nodules_numba(data, positions, size): into your suggestion, but I still get the same error:


Traceback (most recent call last):
  File "<ipython-input-30-1a5a735f9284>", line 3, in <module>
    batch_crops = (luna_dataset >> crops_sampling_pipeline).next_batch(2, shuffle=False)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\radio-0.1.0-py3.6.egg\radio\dataset\dataset\pipeline.py", line 1062, in next_batch
    batch_res = next(self._batch_generator)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\radio-0.1.0-py3.6.egg\radio\dataset\dataset\pipeline.py", line 1035, in gen_batch
    batch_res = self._exec(batch)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\radio-0.1.0-py3.6.egg\radio\dataset\dataset\pipeline.py", line 579, in _exec
    batch_res = self._exec_all_actions(batch)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\radio-0.1.0-py3.6.egg\radio\dataset\dataset\pipeline.py", line 565, in _exec_all_actions
    batch = self._exec_one_action(batch, _action, _action_args, _action['kwargs'])
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\radio-0.1.0-py3.6.egg\radio\dataset\dataset\pipeline.py", line 516, in _exec_one_action
    batch = action_method(*args, **kwargs)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\radio-0.1.0-py3.6.egg\radio\dataset\dataset\decorators.py", line 37, in _action_wrapper
    _res = action_method(action_self, *args, **kwargs)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\radio-0.1.0-py3.6.egg\radio\preprocessing\ct_masked_batch.py", line 650, in sample_nodules
    images = get_nodules_numba(self.images, nodules_st_pos, nodule_size)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\dispatcher.py", line 307, in _compile_for_args
    return self.compile(tuple(argtypes))
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\dispatcher.py", line 579, in compile
    cres = self._compiler.compile(args, return_type)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\dispatcher.py", line 80, in compile
    flags=flags, locals=self.locals)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\compiler.py", line 766, in compile_extra
    return pipeline.compile_extra(func)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\compiler.py", line 362, in compile_extra
    return self._compile_bytecode()
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\compiler.py", line 725, in _compile_bytecode
    return self._compile_core()
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\compiler.py", line 712, in _compile_core
    res = pm.run(self.status)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\compiler.py", line 248, in run
    raise patched_exception
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\compiler.py", line 240, in run
    stage()
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\compiler.py", line 647, in stage_nopython_backend
    self._backend(lowerfn, objectmode=False)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\compiler.py", line 602, in _backend
    lowered = lowerfn()
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\compiler.py", line 589, in backend_nopython_mode
    self.flags)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\compiler.py", line 885, in native_lowering_stage
    lower.lower()
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\lowering.py", line 135, in lower
    self.lower_normal_function(self.fndesc)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\lowering.py", line 176, in lower_normal_function
    entry_block_tail = self.lower_function_body()
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\lowering.py", line 201, in lower_function_body
    self.lower_block(block)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\lowering.py", line 216, in lower_block
    self.lower_inst(inst)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\contextlib.py", line 99, in __exit__
    self.gen.throw(type, value, traceback)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\errors.py", line 265, in new_error_context
    six.reraise(type(newerr), newerr, sys.exc_info()[2])
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\six.py", line 658, in reraise
    raise value.with_traceback(tb)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\errors.py", line 259, in new_error_context
    yield
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\lowering.py", line 216, in lower_block
    self.lower_inst(inst)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\lowering.py", line 265, in lower_inst
    val = self.lower_assign(ty, inst)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\lowering.py", line 411, in lower_assign
    return self.lower_expr(ty, value)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\lowering.py", line 735, in lower_expr
    res = self.lower_call(resty, expr)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\lowering.py", line 701, in lower_call
    res = impl(self.builder, argvals)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\targets\base.py", line 1046, in __call__
    return self._imp(self._context, builder, self._sig, args)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\targets\arrayobj.py", line 3117, in numpy_zeros_nd
    ary = _empty_nd_impl(context, builder, arrtype, shapes)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\numba\targets\arrayobj.py", line 3004, in _empty_nd_impl
    arrlen = builder.mul(arrlen, s)
  File "C:\Users\s120116\AppData\Local\Continuum\anaconda3\lib\site-packages\llvmlite\ir\builder.py", line 24, in wrapped
    % (lhs.type, rhs.type))
LoweringError: Operands must be the same type, got (i64, i32)

Do you have any idea how to solve this problem in another way?

lindehesse commented 6 years ago

I realized i made the changes in a wrong file, the problem is solved now!