kieferk / pymssa

Python implementation of Multivariate Singular Spectrum Analysis (MSSA)
MIT License
152 stars 48 forks source link

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

Open rafidou opened 5 years ago

rafidou commented 5 years ago

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))" ?

vanamalivanam commented 5 years ago

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.

RogerPallares commented 4 years ago

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

RogerPallares commented 4 years ago

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.