inaSpeechSegmenter icon indicating copy to clipboard operation
inaSpeechSegmenter copied to clipboard

warning management

Open DavidDoukhan opened this issue 5 years ago • 6 comments

Do some modifications in script ina_speech_segmenter.py in order to filter the warning messages that should be displayed from those that should be ignored.

DavidDoukhan avatar Oct 14 '19 22:10 DavidDoukhan

Hello, first of all thank you for this amazing work

I have a similar question should I worry about these warnings?

RuntimeWarning: invalid value encountered in subtract x = asanyarray(arr - arrmean)

FutureWarning: arrays to stack must be passed as a "sequence" type such as list or tuple. Support for non-sequence iterables such as generators is deprecated as of NumPy 1.16 and will raise an error in the future. for e, c in six.moves.zip(constraint.T, consecutive)

I am using numpy 1.17.4 and I always prefer to use the last updated version.

AmeeraMilibari avatar Feb 27 '20 07:02 AmeeraMilibari

Here is the full warning report. Some of these warnings are issued from third-party modules. I'll have a look at these soon:

/tmp/env/lib/python3.6/site-packages/sidekit/frontend/features.py:391: RuntimeWarning: divide by zero encountered in log
  log_energy = numpy.log((framed**2).sum(axis=1))
/tmp/env/lib/python3.6/site-packages/sidekit/frontend/features.py:462: RuntimeWarning: divide by zero encountered in log
  mspec = numpy.log(numpy.dot(spec, fbank.T))   # A tester avec log10 et log
/tmp/env/lib/python3.6/site-packages/pyannote/algorithms/utils/viterbi.py:88: FutureWarning: arrays to stack must be passed as a "sequence" type such as list or tuple. Support for non-sequence iterables such as generators is deprecated as of NumPy 1.16 and will raise an error in the future.
  for e, c in six.moves.zip(emission.T, consecutive)
/tmp/env/lib/python3.6/site-packages/pyannote/algorithms/utils/viterbi.py:97: FutureWarning: arrays to stack must be passed as a "sequence" type such as list or tuple. Support for non-sequence iterables such as generators is deprecated as of NumPy 1.16 and will raise an error in the future.
  for e, c in six.moves.zip(constraint.T, consecutive)
/tmp/env/lib/python3.6/site-packages/inaSpeechSegmenter/segmenter.py:74: RuntimeWarning: invalid value encountered in subtract
  data = (data - np.mean(data, axis=1).reshape((len(data), 1))) / np.std(data, axis=1).reshape((len(data), 1))
/tmp/env/lib/python3.6/site-packages/numpy/core/_methods.py:193: RuntimeWarning: invalid value encountered in subtract
  x = asanyarray(arr - arrmean)

DavidDoukhan avatar Feb 28 '20 11:02 DavidDoukhan

Dear @AmeeraMilibari .

You don't need to worry about this warning for now. I guess I'll need to update my code when this piece of code won't be supported by future numpy release.

Kind regards,

Hello, first of all thank you for this amazing work

I have a similar question should I worry about these warnings?

RuntimeWarning: invalid value encountered in subtract x = asanyarray(arr - arrmean)

FutureWarning: arrays to stack must be passed as a "sequence" type such as list or tuple. Support for non-sequence iterables such as generators is deprecated as of NumPy 1.16 and will raise an error in the future. for e, c in six.moves.zip(constraint.T, consecutive)

I am using numpy 1.17.4 and I always prefer to use the last updated version.

DavidDoukhan avatar Feb 28 '20 11:02 DavidDoukhan

Great, thank you @DavidDoukhan, looking forward for the code update

AmeeraMilibari avatar Mar 01 '20 06:03 AmeeraMilibari

Hello @DavidDoukhan, any update on the code since I am facing the same issue now!

Vomini avatar Jan 04 '22 06:01 Vomini

How can I resolve this: /usr/local/lib/python3.7/dist-packages/pyannote/algorithms/utils/viterbi.py:88: FutureWarning: arrays to stack must be passed as a "sequence" type such as list or tuple. Support for non-sequence iterables such as generators is deprecated as of NumPy 1.16 and will raise an error in the future. for e, c in six.moves.zip(emission.T, consecutive) /usr/local/lib/python3.7/dist-packages/pyannote/algorithms/utils/viterbi.py:97: FutureWarning: arrays to stack must be passed as a "sequence" type such as list or tuple. Support for non-sequence iterables such as generators is deprecated as of NumPy 1.16 and will raise an error in the future. for e, c in six.moves.zip(constraint.T, consecutive) /usr/local/lib/python3.7/dist-packages/inaSpeechSegmenter/segmenter.py:60: RuntimeWarning: invalid value encountered in subtract data = (data - np.mean(data, axis=1).reshape((len(data), 1))) / np.std(data, axis=1).reshape((len(data), 1)) /usr/local/lib/python3.7/dist-packages/numpy/core/_methods.py:202: RuntimeWarning: invalid value encountered in subtract x = asanyarray(arr - arrmean)

Vomini avatar Jan 04 '22 06:01 Vomini

It is now illegal. To fix:

sed -i 's/np.vstack(/np.vstack([/;s/    ).T/    ]).T/' ~/.local/lib/python3.*/site-packages/pyannote/algorithms/utils/viterbi.py

JoelSjogren avatar Sep 08 '23 13:09 JoelSjogren

Thanks @JoelSjogren, it works, but it's also terrifying.

Itsindigo avatar Oct 24 '23 21:10 Itsindigo

Dear all, Some changes have been done in the code base for fixing the pyannote dependency bug Kind regards

DavidDoukhan avatar Oct 25 '23 08:10 DavidDoukhan