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

mnn_correct gives several Numba warnings and IndexError #33

Open
auesro opened this issue Apr 17, 2020 · 2 comments
Open

mnn_correct gives several Numba warnings and IndexError #33

auesro opened this issue Apr 17, 2020 · 2 comments

Comments

@auesro
Copy link

auesro commented Apr 17, 2020

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

@Zifeng-L
Copy link

Zifeng-L commented May 2, 2020

亲爱的克里斯,

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

谢谢

I had the same problem as you!!

@gokceneraslan
Copy link

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.

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

No branches or pull requests

3 participants