mnnpy icon indicating copy to clipboard operation
mnnpy copied to clipboard

mnn_correct gives several Numba warnings and IndexError

Open auesro opened this issue 4 years ago • 2 comments

Dear Chris,

I posted this to the SCANPY Github repo but they directed me to you. Any ideas what could be causing this error

Thanks

auesro avatar Apr 17 '20 15:04 auesro

亲爱的克里斯,

我将其发布到了SCANPY Github存储库中,但他们将我引导给了您。 任何想法可能导致此错误的原因

谢谢

I had the same problem as you!!

Zifeng-L avatar May 02 '20 13:05 Zifeng-L

I don't get an error but just the following warnings:

Performing cosine normalization...

/home/gokcen/.miniconda3/lib/python3.8/site-packages/mnnpy/utils.py:14: NumbaWarning: 
Compilation is falling back to object mode WITH looplifting enabled because Function "l2_norm" failed type inference due to: No implementation of function Function(<function norm at 0x7ff304119280>) found for signature:
 
 >>> norm(x=array(float32, 2d, A), axis=Literal[int](1))
 
There are 2 candidate implementations:
    - Of which 2 did not match due to:
    Overload in function 'norm_impl': File: numba/np/linalg.py: Line 2351.
      With argument(s): '(x=array(float32, 2d, A), axis=int64)':
     Rejected as the implementation raised a specific error:
       TypeError: norm_impl() got an unexpected keyword argument 'x'
  raised from /home/gokcen/.miniconda3/lib/python3.8/site-packages/numba/core/typing/templates.py:775

During: resolving callee type: Function(<function norm at 0x7ff304119280>)
During: typing of call at /home/gokcen/.miniconda3/lib/python3.8/site-packages/mnnpy/utils.py (16)


File "../../../../.miniconda3/lib/python3.8/site-packages/mnnpy/utils.py", line 16:
def l2_norm(in_matrix):
    return np.linalg.norm(x=in_matrix, axis=1)
    ^

/home/gokcen/.miniconda3/lib/python3.8/site-packages/numba/core/object_mode_passes.py:151: NumbaWarning: Function "l2_norm" was compiled in object mode without forceobj=True.

File "../../../../.miniconda3/lib/python3.8/site-packages/mnnpy/utils.py", line 15:
@jit(float32[:](float32[:, :]), nogil=True)
def l2_norm(in_matrix):
^

/home/gokcen/.miniconda3/lib/python3.8/site-packages/numba/core/object_mode_passes.py:161: NumbaDeprecationWarning: 
Fall-back from the nopython compilation path to the object mode compilation path has been detected, this is deprecated behaviour.

For more information visit https://numba.pydata.org/numba-doc/latest/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit

File "../../../../.miniconda3/lib/python3.8/site-packages/mnnpy/utils.py", line 15:
@jit(float32[:](float32[:, :]), nogil=True)
def l2_norm(in_matrix):
^

/home/gokcen/.miniconda3/lib/python3.8/site-packages/mnnpy/utils.py:14: NumbaWarning: Code running in object mode won't allow parallel execution despite nogil=True.
/home/gokcen/.miniconda3/lib/python3.8/site-packages/mnnpy/utils.py:14: NumbaWarning: 
Compilation is falling back to object mode WITH looplifting enabled because Function "l2_norm" failed type inference due to: No implementation of function Function(<function norm at 0x7ff304119280>) found for signature:
 
 >>> norm(x=array(float32, 2d, A), axis=Literal[int](1))
 
There are 2 candidate implementations:
    - Of which 2 did not match due to:
    Overload in function 'norm_impl': File: numba/np/linalg.py: Line 2351.
      With argument(s): '(x=array(float32, 2d, A), axis=int64)':
     Rejected as the implementation raised a specific error:
       TypeError: norm_impl() got an unexpected keyword argument 'x'
  raised from /home/gokcen/.miniconda3/lib/python3.8/site-packages/numba/core/typing/templates.py:775

During: resolving callee type: Function(<function norm at 0x7ff304119280>)
During: typing of call at /home/gokcen/.miniconda3/lib/python3.8/site-packages/mnnpy/utils.py (16)


File "../../../../.miniconda3/lib/python3.8/site-packages/mnnpy/utils.py", line 16:
def l2_norm(in_matrix):
    return np.linalg.norm(x=in_matrix, axis=1)
    ^

/home/gokcen/.miniconda3/lib/python3.8/site-packages/numba/core/object_mode_passes.py:151: NumbaWarning: Function "l2_norm" was compiled in object mode without forceobj=True.

File "../../../../.miniconda3/lib/python3.8/site-packages/mnnpy/utils.py", line 15:
@jit(float32[:](float32[:, :]), nogil=True)
def l2_norm(in_matrix):
^

/home/gokcen/.miniconda3/lib/python3.8/site-packages/numba/core/object_mode_passes.py:161: NumbaDeprecationWarning: 
Fall-back from the nopython compilation path to the object mode compilation path has been detected, this is deprecated behaviour.

gokceneraslan avatar Sep 28 '21 02:09 gokceneraslan