mnnpy
mnnpy copied to clipboard
mnnpy fails to import with latest version of numba
mnnpy (version 0.1.9.5) fails to import when using the latest version of numba (0.44.0). Rolling back to the previous version of numba (0.43.1) fixes this issue.
Most of the error messages seem to be related to type errors.
Python 3.6.7+ (heads/3.6:bfb8818, Dec 5 2018, 13:28:38)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mnnpy
/python3.6/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: Invalid use of Function(<function norm at 0x7f43f913cea0>) with argument(s) of type(s): (axis=Literal[int](1), x=array(float32, 2d, A))
* parameterized
In definition 0:
TypeError: norm_impl() got an unexpected keyword argument 'x'
raised from /python3.6/site-packages/numba/typing/templates.py:475
In definition 1:
TypeError: norm_impl() got an unexpected keyword argument 'x'
/lib/python3.6/site-packages/numba/typing/templates.py:475
This error is usually caused by passing an argument of a type that is unsupported by the named function.
[1] During: resolving callee type: Function(<function norm at 0x7f43f913cea0>)
File python3.6/site-packages/mnnpy/utils.py", line 16:
def l2_norm(in_matrix):
return np.linalg.norm(x=in_matrix, axis=1)
^
Having the same error - slew of error messages like this with numba=44.1
Same issue. numba=0.44.1, llvmlite=0.29.0
This specific one is very easy to fix: Just call norm(in_matrix, axis=1)
instead of norm(x=in_matrix, axis=1)
@flying-sheep Still results in TypeError: norm_impl() got an unexpected keyword argument 'axis'
. Looks like the axis
arg is removed, as the axis is inferred internally, if I interpret the source correctly?
https://github.com/numba/numba/blob/88e3dad3d43a59c79e6295f72fc344d77f13330c/numba/targets/linalg.py#L2365-L2371
However, omitting the axis
arg led to other tracebacks, leading to IndexError: invalid index to scalar variable.
?
Well, numba doesn’t seem to support that function properly: numba/numba#2558
They should go fix it.