Exception: LinAlgError和Intel MKL ERROR: Parameter 6 was incorrect on entry to DGELSD【已解决】

问题描述

运行程序,处理到某个数据时候报错:

Exception has occurred: LinAlgError
SVD did not converge in Linear Least Squares
  File "E:\matlab\CHB-MIT-DATA\epilepsy_eeg_classification\pyeeg.py", line 692, in hurst
    [m, c] = numpy.linalg.lstsq(A, R_S)[0]
  File "E:\matlab\CHB-MIT-DATA\epilepsy_eeg_classification\preprocessing.py", line 50, in eeg_features
    res[10] = pyeeg.hurst(data)                                                   # Hurst exponent
  File "E:\matlab\CHB-MIT-DATA\epilepsy_eeg_classification\preprocessing.py", line 88, in eeg_preprocessing
    features.extend(eeg_features(temp[i]).tolist())
  File "E:\matlab\CHB-MIT-DATA\epilepsy_eeg_classification\preprocessing.py", line 334, in 
    res = eeg_preprocessing(file, seizures)
numpy.linalg.LinAlgError: SVD did not converge in Linear Least Squares

Exception: LinAlgError和Intel MKL ERROR: Parameter 6 was incorrect on entry to DGELSD【已解决】_第1张图片

terminal报错如下:

e:\matlab\CHB-MIT-DATA\epilepsy_eeg_classification\pyeeg.py:620: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.
To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.     
  (p, _, _, _) = numpy.linalg.lstsq(x, L)
e:\matlab\CHB-MIT-DATA\epilepsy_eeg_classification\pyeeg.py:688: RuntimeWarning: invalid value encountered in true_divide
  R_S = R_T / S_T
e:\matlab\CHB-MIT-DATA\epilepsy_eeg_classification\pyeeg.py:692: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.
To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.     
  [m, c] = numpy.linalg.lstsq(A, R_S)[0]
Section  1 ; start:  0  ; stop:  2560
Section  2 ; start:  256  ; stop:  2816
Section  3 ; start:  512  ; stop:  3072
Section  4 ; start:  768  ; stop:  3328
Section  5 ; start:  1024  ; stop:  3584
Section  6 ; start:  1280  ; stop:  3840
Section  7 ; start:  1536  ; stop:  4096
Section  8 ; start:  1792  ; stop:  4352
Section  9 ; start:  2048  ; stop:  4608
Section  10 ; start:  2304  ; stop:  4864
Section  11 ; start:  2560  ; stop:  5120
Section  12 ; start:  2816  ; stop:  5376
Section  13 ; start:  3072  ; stop:  5632
Section  14 ; start:  3328  ; stop:  5888
Section  15 ; start:  3584  ; stop:  6144
Section  16 ; start:  3840  ; stop:  6400
Section  17 ; start:  4096  ; stop:  6656
Section  18 ; start:  4352  ; stop:  6912
Section  19 ; start:  4608  ; stop:  7168
Section  20 ; start:  4864  ; stop:  7424
Section  21 ; start:  5120  ; stop:  7680
Section  22 ; start:  5376  ; stop:  7936
Section  23 ; start:  5632  ; stop:  8192
Section  24 ; start:  5888  ; stop:  8448
Section  25 ; start:  6144  ; stop:  8704
Section  26 ; start:  6400  ; stop:  8960
Section  27 ; start:  6656  ; stop:  9216
Section  28 ; start:  6912  ; stop:  9472
Section  29 ; start:  7168  ; stop:  9728
Section  30 ; start:  7424  ; stop:  9984
Section  31 ; start:  7680  ; stop:  10240
Section  32 ; start:  7936  ; stop:  10496
Section  33 ; start:  8192  ; stop:  10752
Section  34 ; start:  8448  ; stop:  11008
Section  35 ; start:  8704  ; stop:  11264
Section  36 ; start:  8960  ; stop:  11520
Section  37 ; start:  9216  ; stop:  11776

Intel MKL ERROR: Parameter 6 was incorrect on entry to DGELSD.
Backend Qt5Agg is interactive backend. Turning interactive mode on.

FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.
To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.     
  (p, _, _, _) = numpy.linalg.lstsq(x, L)
e:\matlab\CHB-MIT-DATA\epilepsy_eeg_classification\pyeeg.py:688: RuntimeWarning: invalid value encountered in true_divide
  R_S = R_T / S_T
e:\matlab\CHB-MIT-DATA\epilepsy_eeg_classification\pyeeg.py:692: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.
To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.   

解决方案

方法1:

有人说numpy1.19.3在linux上起作用,numpy1.19.4在Windows上起作用。因此我把原来的numpy卸载,重装numpy1.19.4。

pip uninstall numpy

pip install numpy==1.19.4

 原来的numpy是1.21.5版本的。

Exception: LinAlgError和Intel MKL ERROR: Parameter 6 was incorrect on entry to DGELSD【已解决】_第2张图片

python - LinAlgError:尝试 polyfit 时 SVD 未在线性最小二乘中收敛 - 堆栈内存溢出

安装1.19.4时候虽然报错了,但是成功安装:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
tensorflow 1.14.0 requires tensorflow-estimator<1.15.0rc0,>=1.14.0rc0, but you have tensorflow-estimator 2.4.0 which is incompatible.     
Successfully installed numpy-1.19.4

 我通过降低了numpy版本的方式解决了这个问题,不知道这个方法对你是否有借鉴意义。

你可能感兴趣的:(python,解决方案,conda,python,numpy,matlab,开发语言,Intel,MKL,ERROR)