Numpy / Polyfit - Suppress printing of Intel MKL Error message

前端 未结 2 1969
醉话见心
醉话见心 2021-01-14 08:05

I\'m computing a polyfit multiple times during a program, and some of my inputs are np.nan and are going to get the algorithm problems. I know thi

相关标签:
2条回答
  • 2021-01-14 08:18

    The error

    Intel MKL ERROR: Parameter 4 was incorrect on entry to DELSD

    occurs when you have Nan or Inf value in your input. Please check and impute it.

    0 讨论(0)
  • 2021-01-14 08:20

    If a function decides to print an error message directly to stdout/stderr without using the normal Python error reporting mechanism (i.e. exception handling and warnings), there's little you can do to stop it from doing so. If it really annoys you, you can apparently suppress writing to stderr altogether. There is a solution in another SO question as to how to do it temporarily (e.g. just for this function): Suppress stdout / stderr print from Python functions. Obviously if you do this, you're also going to miss all the relevant outputs from this function, too, so use it with caution.

    0 讨论(0)
提交回复
热议问题