inaSpeechSegmenter
inaSpeechSegmenter copied to clipboard
warning management
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.
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.
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)
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.
Great, thank you @DavidDoukhan, looking forward for the code update
Hello @DavidDoukhan, any update on the code since I am facing the same issue now!
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)
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
Thanks @JoelSjogren, it works, but it's also terrifying.
Dear all, Some changes have been done in the code base for fixing the pyannote dependency bug Kind regards