Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors in running unit test after development installation #408

Closed
ghost opened this issue Sep 29, 2021 · 3 comments
Closed

Errors in running unit test after development installation #408

ghost opened this issue Sep 29, 2021 · 3 comments

Comments

@ghost
Copy link

ghost commented Sep 29, 2021

Hello, I installed lhotse from github (development installation) as follows:

https://lhotse.readthedocs.io/en/latest/getting-started.html#installation

but I got 3 errors from pytest test as follows:

======== test session starts ==============[79/279]
platform linux -- Python 3.6.9, pytest-5.4.3, py-1.10.0, pluggy-0.13.1
rootdir: /scl_nas/lhotse
plugins: hypothesis-5.41.2
collected 779 items / 3 errors / 776 selected

========= ERRORS========
_________________ ERROR collecting test/test_feature_set.py ____________________________
test/test_feature_set.py:7: in
import torchaudio
/usr/local/lib/python3.6/dist-packages/torchaudio/init.py:14: in
from torchaudio.backend import (
/usr/local/lib/python3.6/dist-packages/torchaudio/backend/init.py:1: in
from . import utils
/usr/local/lib/python3.6/dist-packages/torchaudio/backend/utils.py:7: in
from . import (
/usr/local/lib/python3.6/dist-packages/torchaudio/backend/soundfile_backend.py:15: in
import soundfile
/usr/local/lib/python3.6/dist-packages/soundfile.py:142: in
raise OSError('sndfile library not found')
E OSError: sndfile library not found
____________ ERROR collecting test/augmentation/test_torchaudio.py ________________________________________
test/augmentation/test_torchaudio.py:9: in
torchaudio = pytest.importorskip('torchaudio', minversion='0.6')
/usr/local/lib/python3.6/dist-packages/torchaudio/init.py:14: in
from torchaudio.backend import (
/usr/local/lib/python3.6/dist-packages/torchaudio/backend/init.py:1: in
from . import utils
/usr/local/lib/python3.6/dist-packages/torchaudio/backend/utils.py:7: in
from . import (
/usr/local/lib/python3.6/dist-packages/torchaudio/backend/soundfile_backend.py:15: in
import soundfile
/usr/local/lib/python3.6/dist-packages/soundfile.py:142: in
raise OSError('sndfile library not found')
E OSError: sndfile library not found
___________________ ERROR collecting test/known_issues/test_augment_with_executor.py ___________________
test/known_issues/test_augment_with_executor.py:12: in
torchaudio = pytest.importorskip('torchaudio', minversion='0.7.1')
/usr/local/lib/python3.6/dist-packages/torchaudio/init.py:14: in
from torchaudio.backend import (
/usr/local/lib/python3.6/dist-packages/torchaudio/backend/init.py:1: in
from . import utils
/usr/local/lib/python3.6/dist-packages/torchaudio/backend/utils.py:7: in
from . import (
/usr/local/lib/python3.6/dist-packages/torchaudio/backend/soundfile_backend.py:15: in
import soundfile
/usr/local/lib/python3.6/dist-packages/soundfile.py:142: in
raise OSError('sndfile library not found')
E OSError: sndfile library not found
=========== warnings summary ============
lhotse/recipes/heroico.py:81
/scl_nas/lhotse/lhotse/recipes/heroico.py:81: DeprecationWarning: invalid escape sequence \d
answers_line_pattern = re.compile("\d+/\d+\t.+")

lhotse/recipes/heroico.py:83
/scl_nas/lhotse/lhotse/recipes/heroico.py:83: DeprecationWarning: invalid escape sequence \d
heroico_recitations_line_pattern = re.compile("\d+\t.+")

lhotse/recipes/heroico.py:86
/scl_nas/lhotse/lhotse/recipes/heroico.py:86: DeprecationWarning: invalid escape sequence \d
usma_line_pattern = re.compile("s\d+\t.+")

lhotse/recipes/heroico.py:87
/scl_nas/lhotse/lhotse/recipes/heroico.py:87: DeprecationWarning: invalid escape sequence -
usma_native_demo_pattern = re.compile("usma/native-[fm]-\w+-\S+-\S+-\S+-\S+-\w+\d+")

lhotse/recipes/heroico.py:89
/scl_nas/lhotse/lhotse/recipes/heroico.py:89: DeprecationWarning: invalid escape sequence \d
usma_native_prompt_id_pattern = re.compile('s\d+')

lhotse/recipes/heroico.py:91
/scl_nas/lhotse/lhotse/recipes/heroico.py:91: DeprecationWarning: invalid escape sequence -
"nonnative-[fm]-[a-zA-Z]+\d*-[a-zA-Z]+-[a-zA-Z]+-[a-zA-Z]+-[a-zA-Z]+-[a-zA-Z]+\d+")

lhotse/recipes/heroico.py:92
/scl_nas/lhotse/lhotse/recipes/heroico.py:92: DeprecationWarning: invalid escape sequence .
usma_nonnative_path_pattern = re.compile('nonnative.+.wav')

-- Docs: https://docs.pytest.org/en/latest/warnings.html
====== short test summary info =======
ERROR test/test_feature_set.py - OSError: sndfile library not found
ERROR test/augmentation/test_torchaudio.py - OSError: sndfile library not found
ERROR test/known_issues/test_augment_with_executor.py - OSError: sndfile library not found
!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=========== 7 warnings, 3 errors in 4.34s ==============

To resolve this errors, we consider re-installation of Torchaudio with higher version than 0.7.2?
because version of Torchaudio is 0.7.2.

Other environment is as follows:

Ubuntu OS version: 18.04.5 LTS
Python version: 3.6.9
Cuda version: 11.0
Torch version: 1.7.1+cu110
Torchvision version: torchvision-0.8.2+cu110

@ghost
Copy link
Author

ghost commented Sep 29, 2021

Oh, I got it. I search "OSError: sndfile library not found" and execute the following command:
sudo apt-get install libsndfile1

and it works well with some warnings as follows:

========== test session starts ==========
platform linux -- Python 3.6.9, pytest-5.4.3, py-1.10.0, pluggy-0.13.1
rootdir: /scl_nas/lhotse
plugins: hypothesis-5.41.2collected 833 items

test/test_audio_url.py s [ 0%]
test/test_feature_set.py .............................. [ 3%]
test/test_manipulation.py ...................................................... [ 10%]
test/test_qa.py .... [ 10%]
test/test_recording_set.py .....................................................ssss [ 17%]
test/test_resample_randomized.py . [ 17%]
test/test_serialization.py ...................................................................................... [ 27%]
test/test_supervision_set.py ........................ [ 30%]
test/test_utils.py ......................................... [ 35%]
test/augmentation/test_torchaudio.py ...................... [ 38%]
test/cut/test_cut.py ...................... [ 41%]
test/cut/test_cut_augmentation.py ............................ [ 44%]
test/cut/test_cut_drop_attributes.py ............ [ 45%]test/cut/test_cut_mixing.py ........... [ 47%]
test/cut/test_cut_ops_preserve_id.py ........................................ [ 51%]
test/cut/test_cut_set.py .......................... [ 55%]
test/cut/test_cut_set_creation.py .... [ 55%]
test/cut/test_cut_set_mix.py ......... [ 56%]
test/cut/test_cut_trim_to_supervisions.py ..... [ 57%]
test/cut/test_cut_truncate.py ................................... [ 61%]
test/cut/test_feature_extraction.py ........ssssssss [ 63%]
test/cut/test_invariants_randomized.py .. [ 63%]
test/cut/test_masks.py ................ [ 65%]test/cut/test_padding_cut.py ................................................. [ 71%]
test/dataset/test_collation.py ...... [ 72%]
test/dataset/test_cut_transforms.py ................ [ 74%]
test/dataset/test_dataloading.py s [ 74%]
test/dataset/test_diarization.py . [ 74%]
test/dataset/test_sampling.py .........x...........x..........................................................................................x............. [ 89%]
test/dataset/test_signal_transforms.py ..................... [ 91%]test/dataset/test_speech_recognition_dataset.py ............. [ 93%]
test/dataset/test_speech_recognition_dataset_randomized.py . [ 93%]
test/dataset/test_speech_synthesis_dataset.py ... [ 93%]
test/dataset/test_unsupervised_dataset.py ... [ 94%]
test/dataset/test_vad_dataset.py . [ 94%]
test/features/test_kaldi_features.py .... [ 94%]
test/features/test_librosa_fbank.py ..........ssssss [ 96%]
test/known_issues/test_augment_with_executor.py .s [ 97%]
test/known_issues/test_cut_consistency.py ...................... [ 99%]
test/known_issues/test_mixed_cut_num_frames.py .. [100%]

============= warnings summary =========
/usr/local/lib/python3.6/dist-packages/torchaudio/backend/utils.py:54
/usr/local/lib/python3.6/dist-packages/torchaudio/backend/utils.py:54: UserWarning: "sox" backend is being deprecated. The default backend will be changed to "sox_io" backend in 0.8.0 and "sox" backend will be removed in 0.9.0. Please migrate to "sox_io" backend. Please refer to pytorch/audio#903 for the detail.
'"sox" backend is being deprecated. '

test/test_feature_set.py::test_feature_extractor[mfcc-exception_expectation0]
/usr/local/lib/python3.6/dist-packages/torchaudio/compliance/kaldi.py:574: UserWarning: The function torch.rfft is deprecated and will be removed in a future PyTorch release. Use the new torch.fft module functions, instead, by importing torch.fft and calling torch.fft.fft or torch.fft.rfft. (Triggered internally at /pytorch/aten/src/ATen/native/SpectralOps.cpp:590.)
fft = torch.rfft(strided_input, 1, normalized=False, onesided=True)

test/test_serialization.py: 1 test with warning
test/cut/test_cut.py: 8 tests with warnings
test/cut/test_cut_set.py: 2 tests with warnings
test/dataset/test_collation.py: 2 tests with warnings
test/dataset/test_diarization.py: 1 test with warning
test/dataset/test_sampling.py: 1 test with warning
test/dataset/test_signal_transforms.py: 16 tests with warnings
test/dataset/test_speech_recognition_dataset.py: 12 tests with warnings
test/dataset/test_speech_synthesis_dataset.py: 3 tests with warnings
test/dataset/test_unsupervised_dataset.py: 3 tests with warnings
test/dataset/test_vad_dataset.py: 1 test with warning
/scl_nas/lhotse/lhotse/cut.py:2208: UserWarning: Your manifest was created with Lhotse version earlier than v0.8, when MonoCut was called Cut. Please re-generate it with Lhotse v0.8 as it might stop working in a future version (usingmanifest.from_file() and then manifest.to_file() should be sufficient).
'Your manifest was created with Lhotse version earlier than v0.8, when MonoCut was called Cut. '

test/cut/test_cut_set.py::test_cut_set_describe_runs
/usr/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
return f(*args, **kwds)

test/dataset/test_sampling.py::test_single_cut_sampler_low_max_frames
test/dataset/test_speech_recognition_dataset.py::test_k2_speech_recognition_iterable_dataset_low_max_frames
/scl_nas/lhotse/lhotse/dataset/sampling/single_cut.py:171: UserWarning: The first cut drawn in batch collection violates the max_frames, max_cuts, or max_duration constraints - we'll return it anyway. Consider increasing max_frames/max_cuts/max_duration.
"The first cut drawn in batch collection violates "

test/dataset/test_sampling.py::test_bucketing_sampler_single_cuts_equal_duration
test/dataset/test_sampling.py::test_bucketing_sampler_cut_pairs_equal_duration[False]
test/dataset/test_sampling.py::test_bucketing_sampler_cut_pairs_equal_duration[True]
/scl_nas/lhotse/lhotse/dataset/sampling/bucketing.py:328: DeprecationWarning: Calling np.sum(generator) is deprecated, and in the future will give a different result. Use np.sum(np.fromiter(generator)) or the python sum builtin instead.
total_duration = np.sum(c.duration for c in cuts)

test/dataset/test_sampling.py::test_single_cut_sampler_with_lazy_cuts[BucketingSampler]
test/dataset/test_sampling.py::test_single_cut_sampler_lazy_shuffle[BucketingSampler]
test/dataset/test_sampling.py::test_cut_pairs_sampler_lazy_shuffle[BucketingSampler]
/scl_nas/lhotse/lhotse/dataset/sampling/bucketing.py:96: UserWarning: Lazy CutSet detected in BucketingSampler: this is not well supported yet, and you might experience a potentially long lag while the buckets are being created.
"Lazy CutSet detected in BucketingSampler: this is not well supported yet, "

-- Docs: https://docs.pytest.org/en/latest/warnings.html
================ 809 passed, 21 skipped, 3 xfailed, 61 warnings in 94.33s (0:01:34) ========================

@pzelasko
Copy link
Collaborator

The warnings are expected. I think you’re good to go.

@ghost
Copy link
Author

ghost commented Oct 1, 2021

@pzelasko Thank you, I'll close this issue.

@ghost ghost closed this as completed Oct 1, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant