pymssa icon indicating copy to clipboard operation
pymssa copied to clipboard

def incremental_component_reconstruction -> numba LoweringError: Operands must be the same type, got (i64, i32)

Open rafidou opened this issue 5 years ago • 3 comments

I haven't found a workaround to make the incremental_component_reconstruction method work (in optimized package) with numba the issue and because of it it's quite slow to execute...

Has anyone encountered and found a solution for this issue: numba "LoweringError: Operands must be the same type, got (i64, i32)" which appears when initializing the "components" array "components = np.zeros((P, N, rank))" ?

rafidou avatar Jul 01 '19 17:07 rafidou

Found the same issue on Windows with python 3.6.7 and numba==0.43.0 and numba==0.44.0. This issue doesnt happen in linux (ubuntu 16.04 ) and python 3.6.7.

vanamalivanam avatar Jul 20 '19 06:07 vanamalivanam

I found the same issue on Windows 10 with python 3.7.3 and numba 0.45.1

RogerPallares avatar Oct 17 '19 09:10 RogerPallares

This problem is from numba, not pymssa library. In fact, I managed to solve the error with these 2 steps:

  1. Find and open the optimized.py source code.
  2. Once opened, go to line 226: components = np.zeros((P, N, rank)). You must force the P, N and rank variables to be int64. Hence, you can modify this line of code as follows: components = np.zeros((np.int64(P), np.int64(N), np.int64(rank))).

This modification worked for me. No more errors obtained. Hope you can also solve it.

RogerPallares avatar Oct 17 '19 10:10 RogerPallares