I encountered error LinAlgError("Singular matrix") that occurred from criteria.py (line 18: vce = np.linalg.solve(im,np.eye(im.shape[0])).
It seems that in this operation, the matrix is singular, but the determinant is not 0 due to floating-point number issue, as mentioned here. As a result, despite the check if np.linalg.det(im) != 0: on line 17, the next line of code is still executed.
Therefore, I suggest using np.isclose(<determinant>,0).
Note: if relevant, this error occurred in Linux, but not in Windows.
Hi Jose,
I encountered error
LinAlgError("Singular matrix")
that occurred fromcriteria.py
(line 18:vce = np.linalg.solve(im,np.eye(im.shape[0]))
.It seems that in this operation, the matrix is singular, but the determinant is not 0 due to floating-point number issue, as mentioned here. As a result, despite the check
if np.linalg.det(im) != 0:
on line 17, the next line of code is still executed.Therefore, I suggest using
np.isclose(<determinant>,0)
.Note: if relevant, this error occurred in Linux, but not in Windows.