Skip to content

Instantly share code, notes, and snippets.

@peterjc123
Last active January 7, 2020 03:23
Show Gist options
  • Save peterjc123/4f5b43ce372905c82333f7693a65a15c to your computer and use it in GitHub Desktop.
Save peterjc123/4f5b43ce372905c82333f7693a65a15c to your computer and use it in GitHub Desktop.
Test results for torchaudio on Windows
test_fbank (__main__.Test_Kaldi) ... fbank-0.0939-4.5062-1.0625-0.6875-1841-true-479-5-0.84-true-true-true-true-true-true-true-false-1832-1824-1.0000-hanning.ark
abs_mse: 0.0 abs_max_error: 0.0
relative_mse: nan relative_max_error: nan
fbank-0.1660-1.7875-1.1250-0.5000-4999-true-1740-6-0.29-true-false-true-false-false-true-false-true-4587-2289-1.0000-povey.ark
abs_mse: 3.876771484349235e+16 abs_max_error: 351472480.0
relative_mse: 0.9917999505996704 relative_max_error: 1.0
FAIL
test_get_strided (__main__.Test_Kaldi) ... ok
test_mfcc (__main__.Test_Kaldi) ... mfcc-0.0063-3.0323-0.6250-0.0625-5842-false-3240-4-0.29-true-false-true-true-true-true-2-73.5792-5749-4449-1.0000-blackman.ark
abs_mse: 0.01947879046201706 abs_max_error: 0.31884944438934326
relative_mse: 0.49999886751174927 relative_max_error: 1.0000008344650269
FAIL
test_mfcc_empty (__main__.Test_Kaldi) ... ok
test_resample_waveform (__main__.Test_Kaldi) ... resample-16000-1000.ark
abs_mse: 7453878.0 abs_max_error: 2958.0
relative_mse: 0.9999390244483948 relative_max_error: 0.9999695420265198
FAIL
test_resample_waveform_downsample_accuracy (__main__.Test_Kaldi) ... ok
test_resample_waveform_downsample_size (__main__.Test_Kaldi) ... ok
test_resample_waveform_identity_size (__main__.Test_Kaldi) ... ok
test_resample_waveform_multi_channel (__main__.Test_Kaldi) ... ok
test_resample_waveform_upsample_accuracy (__main__.Test_Kaldi) ... ok
test_resample_waveform_upsample_size (__main__.Test_Kaldi) ... ok
test_spectrogram (__main__.Test_Kaldi) ... spec-0.0016-0-4.6680-0.6250-0.2500-0.82-false-false-false-false-false-povey.ark
abs_mse: 402.9626770019531 abs_max_error: 20.79447364807129
relative_mse: 2.074690103530884 relative_max_error: 3.229877471923828
FAIL
======================================================================
FAIL: test_fbank (__main__.Test_Kaldi)
----------------------------------------------------------------------
Traceback (most recent call last):
File ".\test_compliance_kaldi.py", line 211, in test_fbank
self._compliance_test_helper(self.test_filepath, 'fbank', 97, 22, get_output_fn, atol=1e-3, rtol=1e-1)
File ".\test_compliance_kaldi.py", line 161, in _compliance_test_helper
self.assertTrue(torch.allclose(output, kaldi_output, atol=atol, rtol=rtol))
AssertionError: False is not true
======================================================================
FAIL: test_mfcc (__main__.Test_Kaldi)
----------------------------------------------------------------------
Traceback (most recent call last):
File ".\test_compliance_kaldi.py", line 241, in test_mfcc
self._compliance_test_helper(self.test_filepath, 'mfcc', 145, 22, get_output_fn, atol=1e-3)
File ".\test_compliance_kaldi.py", line 161, in _compliance_test_helper
self.assertTrue(torch.allclose(output, kaldi_output, atol=atol, rtol=rtol))
AssertionError: False is not true
======================================================================
FAIL: test_resample_waveform (__main__.Test_Kaldi)
----------------------------------------------------------------------
Traceback (most recent call last):
File ".\test_compliance_kaldi.py", line 252, in test_resample_waveform
self._compliance_test_helper(self.test_8000_filepath, 'resample', 32, 3, get_output_fn, atol=1e-2, rtol=1e-5)
File ".\test_compliance_kaldi.py", line 161, in _compliance_test_helper
self.assertTrue(torch.allclose(output, kaldi_output, atol=atol, rtol=rtol))
AssertionError: False is not true
======================================================================
FAIL: test_spectrogram (__main__.Test_Kaldi)
----------------------------------------------------------------------
Traceback (most recent call last):
File ".\test_compliance_kaldi.py", line 181, in test_spectrogram
self._compliance_test_helper(self.test_filepath, 'spec', 131, 13, get_output_fn, atol=1e-3, rtol=0)
File ".\test_compliance_kaldi.py", line 161, in _compliance_test_helper
self.assertTrue(torch.allclose(output, kaldi_output, atol=atol, rtol=rtol))
AssertionError: False is not true
----------------------------------------------------------------------
Ran 12 tests in 2.814s
FAILED (failures=4)
```pytb
PS> pytest --maxfail 10000000000 ================================================= test session starts =================================================
platform win32 -- Python 3.7.4, pytest-5.2.1, py-1.8.0, pluggy-0.13.0
plugins: arraydiff-0.3, doctestplus-0.4.0, openfiles-0.4.0, remotedata-0.3.2
collected 87 items
test_compliance_kaldi.py F.F.F......F [ 13%]
test_dataloader.py E [ 14%]
test_functional.py sss.................. [ 39%]
test_functional_filtering.py FFF...FFF [ 49%]
test_kaldi_io.py FFF [ 52%]
test_sox_effects.py EEEEEEEEEEEEEEEE [ 71%]
test_transforms.py .FF...sF................. [100%]
======================================================= ERRORS ========================================================
______________________________________ ERROR at setup of Test_DataLoader.test_1 _______________________________________
cls = <class 'test_dataloader.Test_DataLoader'>
@classmethod
def setUpClass(cls):
> torchaudio.initialize_sox()
test_dataloader.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
@wraps(func)
def wrapper(*args, **kwargs):
if get_audio_backend() not in backends:
> raise RuntimeError("Function {} requires backend to be one of {}.".format(func.__name__, backends))
E RuntimeError: Function initialize_sox requires backend to be one of ['sox'].
..\torchaudio\_backend.py:51: RuntimeError
_______________________________ ERROR at setup of Test_SoxEffectsChain.test_band_chorus _______________________________
cls = <class 'test_sox_effects.Test_SoxEffectsChain'>
@classmethod
def setUpClass(cls):
> torchaudio.initialize_sox()
test_sox_effects.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
@wraps(func)
def wrapper(*args, **kwargs):
if get_audio_backend() not in backends:
> raise RuntimeError("Function {} requires backend to be one of {}.".format(func.__name__, backends))
E RuntimeError: Function initialize_sox requires backend to be one of ['sox'].
..\torchaudio\_backend.py:51: RuntimeError
______________________________ ERROR at setup of Test_SoxEffectsChain.test_biquad_delay _______________________________
cls = <class 'test_sox_effects.Test_SoxEffectsChain'>
@classmethod
def setUpClass(cls):
> torchaudio.initialize_sox()
test_sox_effects.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
@wraps(func)
def wrapper(*args, **kwargs):
if get_audio_backend() not in backends:
> raise RuntimeError("Function {} requires backend to be one of {}.".format(func.__name__, backends))
E RuntimeError: Function initialize_sox requires backend to be one of ['sox'].
..\torchaudio\_backend.py:51: RuntimeError
______________________________ ERROR at setup of Test_SoxEffectsChain.test_compand_fade _______________________________
cls = <class 'test_sox_effects.Test_SoxEffectsChain'>
@classmethod
def setUpClass(cls):
> torchaudio.initialize_sox()
test_sox_effects.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
@wraps(func)
def wrapper(*args, **kwargs):
if get_audio_backend() not in backends:
> raise RuntimeError("Function {} requires backend to be one of {}.".format(func.__name__, backends))
E RuntimeError: Function initialize_sox requires backend to be one of ['sox'].
..\torchaudio\_backend.py:51: RuntimeError
__________________________________ ERROR at setup of Test_SoxEffectsChain.test_gain ___________________________________
cls = <class 'test_sox_effects.Test_SoxEffectsChain'>
@classmethod
def setUpClass(cls):
> torchaudio.initialize_sox()
test_sox_effects.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
@wraps(func)
def wrapper(*args, **kwargs):
if get_audio_backend() not in backends:
> raise RuntimeError("Function {} requires backend to be one of {}.".format(func.__name__, backends))
E RuntimeError: Function initialize_sox requires backend to be one of ['sox'].
..\torchaudio\_backend.py:51: RuntimeError
___________________________ ERROR at setup of Test_SoxEffectsChain.test_invalid_effect_name ___________________________
cls = <class 'test_sox_effects.Test_SoxEffectsChain'>
@classmethod
def setUpClass(cls):
> torchaudio.initialize_sox()
test_sox_effects.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
@wraps(func)
def wrapper(*args, **kwargs):
if get_audio_backend() not in backends:
> raise RuntimeError("Function {} requires backend to be one of {}.".format(func.__name__, backends))
E RuntimeError: Function initialize_sox requires backend to be one of ['sox'].
..\torchaudio\_backend.py:51: RuntimeError
_________________________ ERROR at setup of Test_SoxEffectsChain.test_invalid_effect_options __________________________
cls = <class 'test_sox_effects.Test_SoxEffectsChain'>
@classmethod
def setUpClass(cls):
> torchaudio.initialize_sox()
test_sox_effects.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
@wraps(func)
def wrapper(*args, **kwargs):
if get_audio_backend() not in backends:
> raise RuntimeError("Function {} requires backend to be one of {}.".format(func.__name__, backends))
E RuntimeError: Function initialize_sox requires backend to be one of ['sox'].
..\torchaudio\_backend.py:51: RuntimeError
______________________________ ERROR at setup of Test_SoxEffectsChain.test_lowpass_speed ______________________________
cls = <class 'test_sox_effects.Test_SoxEffectsChain'>
@classmethod
def setUpClass(cls):
> torchaudio.initialize_sox()
test_sox_effects.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
@wraps(func)
def wrapper(*args, **kwargs):
if get_audio_backend() not in backends:
> raise RuntimeError("Function {} requires backend to be one of {}.".format(func.__name__, backends))
E RuntimeError: Function initialize_sox requires backend to be one of ['sox'].
..\torchaudio\_backend.py:51: RuntimeError
______________________________ ERROR at setup of Test_SoxEffectsChain.test_rate_channels ______________________________
cls = <class 'test_sox_effects.Test_SoxEffectsChain'>
@classmethod
def setUpClass(cls):
> torchaudio.initialize_sox()
test_sox_effects.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
@wraps(func)
def wrapper(*args, **kwargs):
if get_audio_backend() not in backends:
> raise RuntimeError("Function {} requires backend to be one of {}.".format(func.__name__, backends))
E RuntimeError: Function initialize_sox requires backend to be one of ['sox'].
..\torchaudio\_backend.py:51: RuntimeError
_________________________________ ERROR at setup of Test_SoxEffectsChain.test_reverse _________________________________
cls = <class 'test_sox_effects.Test_SoxEffectsChain'>
@classmethod
def setUpClass(cls):
> torchaudio.initialize_sox()
test_sox_effects.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
@wraps(func)
def wrapper(*args, **kwargs):
if get_audio_backend() not in backends:
> raise RuntimeError("Function {} requires backend to be one of {}.".format(func.__name__, backends))
E RuntimeError: Function initialize_sox requires backend to be one of ['sox'].
..\torchaudio\_backend.py:51: RuntimeError
____________________________ ERROR at setup of Test_SoxEffectsChain.test_silence_contrast _____________________________
cls = <class 'test_sox_effects.Test_SoxEffectsChain'>
@classmethod
def setUpClass(cls):
> torchaudio.initialize_sox()
test_sox_effects.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
@wraps(func)
def wrapper(*args, **kwargs):
if get_audio_backend() not in backends:
> raise RuntimeError("Function {} requires backend to be one of {}.".format(func.__name__, backends))
E RuntimeError: Function initialize_sox requires backend to be one of ['sox'].
..\torchaudio\_backend.py:51: RuntimeError
_____________________________ ERROR at setup of Test_SoxEffectsChain.test_single_channel ______________________________
cls = <class 'test_sox_effects.Test_SoxEffectsChain'>
@classmethod
def setUpClass(cls):
> torchaudio.initialize_sox()
test_sox_effects.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
@wraps(func)
def wrapper(*args, **kwargs):
if get_audio_backend() not in backends:
> raise RuntimeError("Function {} requires backend to be one of {}.".format(func.__name__, backends))
E RuntimeError: Function initialize_sox requires backend to be one of ['sox'].
..\torchaudio\_backend.py:51: RuntimeError
__________________________________ ERROR at setup of Test_SoxEffectsChain.test_synth __________________________________
cls = <class 'test_sox_effects.Test_SoxEffectsChain'>
@classmethod
def setUpClass(cls):
> torchaudio.initialize_sox()
test_sox_effects.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
@wraps(func)
def wrapper(*args, **kwargs):
if get_audio_backend() not in backends:
> raise RuntimeError("Function {} requires backend to be one of {}.".format(func.__name__, backends))
E RuntimeError: Function initialize_sox requires backend to be one of ['sox'].
..\torchaudio\_backend.py:51: RuntimeError
_____________________________ ERROR at setup of Test_SoxEffectsChain.test_tempo_or_speed ______________________________
cls = <class 'test_sox_effects.Test_SoxEffectsChain'>
@classmethod
def setUpClass(cls):
> torchaudio.initialize_sox()
test_sox_effects.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
@wraps(func)
def wrapper(*args, **kwargs):
if get_audio_backend() not in backends:
> raise RuntimeError("Function {} requires backend to be one of {}.".format(func.__name__, backends))
E RuntimeError: Function initialize_sox requires backend to be one of ['sox'].
..\torchaudio\_backend.py:51: RuntimeError
__________________________________ ERROR at setup of Test_SoxEffectsChain.test_trim ___________________________________
cls = <class 'test_sox_effects.Test_SoxEffectsChain'>
@classmethod
def setUpClass(cls):
> torchaudio.initialize_sox()
test_sox_effects.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
@wraps(func)
def wrapper(*args, **kwargs):
if get_audio_backend() not in backends:
> raise RuntimeError("Function {} requires backend to be one of {}.".format(func.__name__, backends))
E RuntimeError: Function initialize_sox requires backend to be one of ['sox'].
..\torchaudio\_backend.py:51: RuntimeError
____________________________ ERROR at setup of Test_SoxEffectsChain.test_ulaw_and_siginfo _____________________________
cls = <class 'test_sox_effects.Test_SoxEffectsChain'>
@classmethod
def setUpClass(cls):
> torchaudio.initialize_sox()
test_sox_effects.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
@wraps(func)
def wrapper(*args, **kwargs):
if get_audio_backend() not in backends:
> raise RuntimeError("Function {} requires backend to be one of {}.".format(func.__name__, backends))
E RuntimeError: Function initialize_sox requires backend to be one of ['sox'].
..\torchaudio\_backend.py:51: RuntimeError
__________________________ ERROR at setup of Test_SoxEffectsChain.test_unimplemented_effect ___________________________
cls = <class 'test_sox_effects.Test_SoxEffectsChain'>
@classmethod
def setUpClass(cls):
> torchaudio.initialize_sox()
test_sox_effects.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
@wraps(func)
def wrapper(*args, **kwargs):
if get_audio_backend() not in backends:
> raise RuntimeError("Function {} requires backend to be one of {}.".format(func.__name__, backends))
E RuntimeError: Function initialize_sox requires backend to be one of ['sox'].
..\torchaudio\_backend.py:51: RuntimeError
====================================================== FAILURES =======================================================
________________________________________________ Test_Kaldi.test_fbank ________________________________________________
self = <test_compliance_kaldi.Test_Kaldi testMethod=test_fbank>
def test_fbank(self):
def get_output_fn(sound, args):
output = kaldi.fbank(
sound,
blackman_coeff=args[1],
dither=0.0,
energy_floor=args[2],
frame_length=args[3],
frame_shift=args[4],
high_freq=args[5],
htk_compat=args[6],
low_freq=args[7],
num_mel_bins=args[8],
preemphasis_coefficient=args[9],
raw_energy=args[10],
remove_dc_offset=args[11],
round_to_power_of_two=args[12],
snip_edges=args[13],
subtract_mean=args[14],
use_energy=args[15],
use_log_fbank=args[16],
use_power=args[17],
vtln_high=args[18],
vtln_low=args[19],
vtln_warp=args[20],
window_type=args[21])
return output
> self._compliance_test_helper(self.test_filepath, 'fbank', 97, 22, get_output_fn, atol=1e-3, rtol=1e-1)
test_compliance_kaldi.py:211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_compliance_kaldi.py:146: in _compliance_test_helper
kaldi_output_dict = {k: v for k, v in torchaudio.kaldi_io.read_mat_ark(kaldi_output_path)}
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_or_fd = 'Temp\\tmp3ellxtph\\assets\\kaldi\\fbank-0.0939-4.5062-1.0625-0.6875-1841-true-479-5-0.84-true-true-true-true-true-true-true-false-1832-1824-1.0000-hanning.ark'
def read_mat_ark(file_or_fd):
r"""Create generator of (key,matrix<float32/float64>) tuples, which reads from the ark file/stream.
Args:
file_or_fd (str/FileDescriptor): ark, gzipped ark, pipe or opened file descriptor
Returns:
Generator[str, torch.Tensor]: The string is the key and the tensor is the matrix read from file
Example
>>> # read ark to a 'dictionary'
>>> d = { u:d for u,d in torchaudio.kaldi_io.read_mat_ark(file) }
"""
> return _convert_method_output_to_tensor(file_or_fd, kaldi_io.read_mat_ark)
E NameError: name 'kaldi_io' is not defined
..\torchaudio\kaldi_io.py:127: NameError
------------------------------------------------ Captured stdout call -------------------------------------------------
fbank-0.0939-4.5062-1.0625-0.6875-1841-true-479-5-0.84-true-true-true-true-true-true-true-false-1832-1824-1.0000-hanning.ark
________________________________________________ Test_Kaldi.test_mfcc _________________________________________________
self = <test_compliance_kaldi.Test_Kaldi testMethod=test_mfcc>
def test_mfcc(self):
def get_output_fn(sound, args):
output = kaldi.mfcc(
sound,
blackman_coeff=args[1],
dither=0.0,
energy_floor=args[2],
frame_length=args[3],
frame_shift=args[4],
high_freq=args[5],
htk_compat=args[6],
low_freq=args[7],
num_mel_bins=args[8],
preemphasis_coefficient=args[9],
raw_energy=args[10],
remove_dc_offset=args[11],
round_to_power_of_two=args[12],
snip_edges=args[13],
subtract_mean=args[14],
use_energy=args[15],
num_ceps=args[16],
cepstral_lifter=args[17],
vtln_high=args[18],
vtln_low=args[19],
vtln_warp=args[20],
window_type=args[21])
return output
> self._compliance_test_helper(self.test_filepath, 'mfcc', 145, 22, get_output_fn, atol=1e-3)
test_compliance_kaldi.py:241:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_compliance_kaldi.py:146: in _compliance_test_helper
kaldi_output_dict = {k: v for k, v in torchaudio.kaldi_io.read_mat_ark(kaldi_output_path)}
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_or_fd = 'Temp\\tmp3ellxtph\\assets\\kaldi\\mfcc-0.0063-3.0323-0.6250-0.0625-5842-false-3240-4-0.29-true-false-true-true-true-true-2-73.5792-5749-4449-1.0000-blackman.ark'
def read_mat_ark(file_or_fd):
r"""Create generator of (key,matrix<float32/float64>) tuples, which reads from the ark file/stream.
Args:
file_or_fd (str/FileDescriptor): ark, gzipped ark, pipe or opened file descriptor
Returns:
Generator[str, torch.Tensor]: The string is the key and the tensor is the matrix read from file
Example
>>> # read ark to a 'dictionary'
>>> d = { u:d for u,d in torchaudio.kaldi_io.read_mat_ark(file) }
"""
> return _convert_method_output_to_tensor(file_or_fd, kaldi_io.read_mat_ark)
E NameError: name 'kaldi_io' is not defined
..\torchaudio\kaldi_io.py:127: NameError
------------------------------------------------ Captured stdout call -------------------------------------------------
mfcc-0.0063-3.0323-0.6250-0.0625-5842-false-3240-4-0.29-true-false-true-true-true-true-2-73.5792-5749-4449-1.0000-blackman.ark
__________________________________________ Test_Kaldi.test_resample_waveform __________________________________________
self = <test_compliance_kaldi.Test_Kaldi testMethod=test_resample_waveform>
def test_resample_waveform(self):
def get_output_fn(sound, args):
output = kaldi.resample_waveform(sound, args[1], args[2])
return output
> self._compliance_test_helper(self.test_8000_filepath, 'resample', 32, 3, get_output_fn, atol=1e-2, rtol=1e-5)
test_compliance_kaldi.py:252:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_compliance_kaldi.py:146: in _compliance_test_helper
kaldi_output_dict = {k: v for k, v in torchaudio.kaldi_io.read_mat_ark(kaldi_output_path)}
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_or_fd = 'Temp\\tmp3ellxtph\\assets\\kaldi\\resample-16000-1000.ark'
def read_mat_ark(file_or_fd):
r"""Create generator of (key,matrix<float32/float64>) tuples, which reads from the ark file/stream.
Args:
file_or_fd (str/FileDescriptor): ark, gzipped ark, pipe or opened file descriptor
Returns:
Generator[str, torch.Tensor]: The string is the key and the tensor is the matrix read from file
Example
>>> # read ark to a 'dictionary'
>>> d = { u:d for u,d in torchaudio.kaldi_io.read_mat_ark(file) }
"""
> return _convert_method_output_to_tensor(file_or_fd, kaldi_io.read_mat_ark)
E NameError: name 'kaldi_io' is not defined
..\torchaudio\kaldi_io.py:127: NameError
------------------------------------------------ Captured stdout call -------------------------------------------------
resample-16000-1000.ark
_____________________________________________ Test_Kaldi.test_spectrogram _____________________________________________
self = <test_compliance_kaldi.Test_Kaldi testMethod=test_spectrogram>
def test_spectrogram(self):
def get_output_fn(sound, args):
output = kaldi.spectrogram(
sound,
blackman_coeff=args[1],
dither=args[2],
energy_floor=args[3],
frame_length=args[4],
frame_shift=args[5],
preemphasis_coefficient=args[6],
raw_energy=args[7],
remove_dc_offset=args[8],
round_to_power_of_two=args[9],
snip_edges=args[10],
subtract_mean=args[11],
window_type=args[12])
return output
> self._compliance_test_helper(self.test_filepath, 'spec', 131, 13, get_output_fn, atol=1e-3, rtol=0)
test_compliance_kaldi.py:181:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_compliance_kaldi.py:146: in _compliance_test_helper
kaldi_output_dict = {k: v for k, v in torchaudio.kaldi_io.read_mat_ark(kaldi_output_path)}
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_or_fd = 'Temp\\tmp3ellxtph\\assets\\kaldi\\spec-0.0016-0-4.6680-0.6250-0.2500-0.82-false-false-false-false-false-povey.ark'
def read_mat_ark(file_or_fd):
r"""Create generator of (key,matrix<float32/float64>) tuples, which reads from the ark file/stream.
Args:
file_or_fd (str/FileDescriptor): ark, gzipped ark, pipe or opened file descriptor
Returns:
Generator[str, torch.Tensor]: The string is the key and the tensor is the matrix read from file
Example
>>> # read ark to a 'dictionary'
>>> d = { u:d for u,d in torchaudio.kaldi_io.read_mat_ark(file) }
"""
> return _convert_method_output_to_tensor(file_or_fd, kaldi_io.read_mat_ark)
E NameError: name 'kaldi_io' is not defined
..\torchaudio\kaldi_io.py:127: NameError
------------------------------------------------ Captured stdout call -------------------------------------------------
spec-0.0016-0-4.6680-0.6250-0.2500-0.82-false-false-false-false-false-povey.ark
_______________________________________ TestFunctionalFiltering.test_equalizer ________________________________________
self = <test_functional_filtering.TestFunctionalFiltering testMethod=test_equalizer>
def test_equalizer(self):
"""
Test biquad peaking equalizer filter, compare to SoX implementation
"""
CENTER_FREQ = 300
Q = 0.707
GAIN = 1
noise_filepath = os.path.join(self.test_dirpath, "assets", "whitenoise.mp3")
> E = torchaudio.sox_effects.SoxEffectsChain()
test_functional_filtering.py:161:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
..\torchaudio\sox_effects.py:94: in __init__
self.EFFECTS_AVAILABLE = set(effect_names())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
@wraps(func)
def wrapper(*args, **kwargs):
if get_audio_backend() not in backends:
> raise RuntimeError("Function {} requires backend to be one of {}.".format(func.__name__, backends))
E RuntimeError: Function effect_names requires backend to be one of ['sox'].
..\torchaudio\_backend.py:51: RuntimeError
________________________________________ TestFunctionalFiltering.test_highpass ________________________________________
self = <test_functional_filtering.TestFunctionalFiltering testMethod=test_highpass>
def test_highpass(self):
"""
Test biquad highpass filter, compare to SoX implementation
"""
CUTOFF_FREQ = 2000
noise_filepath = os.path.join(self.test_dirpath, "assets", "whitenoise.mp3")
> E = torchaudio.sox_effects.SoxEffectsChain()
test_functional_filtering.py:139:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
..\torchaudio\sox_effects.py:94: in __init__
self.EFFECTS_AVAILABLE = set(effect_names())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
@wraps(func)
def wrapper(*args, **kwargs):
if get_audio_backend() not in backends:
> raise RuntimeError("Function {} requires backend to be one of {}.".format(func.__name__, backends))
E RuntimeError: Function effect_names requires backend to be one of ['sox'].
..\torchaudio\_backend.py:51: RuntimeError
________________________________________ TestFunctionalFiltering.test_lfilter _________________________________________
self = <test_functional_filtering.TestFunctionalFiltering testMethod=test_lfilter>
def test_lfilter(self):
filepath = os.path.join(self.test_dirpath, "assets", "whitenoise.mp3")
> waveform, _ = torchaudio.load(filepath, normalization=True)
test_functional_filtering.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
..\torchaudio\__init__.py:86: in load
filetype=filetype,
..\torchaudio\_soundfile_backend.py:86: in load
filepath, frames=num_frames, start=offset, dtype="float32", always_2d=True
Anaconda3\lib\site-packages\soundfile.py:257: in read
subtype, endian, format, closefd) as f:
Anaconda3\lib\site-packages\soundfile.py:629: in __init__
self._file = self._open(file, mode_int, closefd)
Anaconda3\lib\site-packages\soundfile.py:1184: in _open
"Error opening {0!r}: ".format(self.name))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
err = 21
prefix = "Error opening 'Temp\\\\tmpcd1ldlz6\\\\assets\\\\whitenoise.mp3': "
def _error_check(err, prefix=""):
"""Pretty-print a numerical error code if there is an error."""
if err != 0:
err_str = _snd.sf_error_number(err)
> raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace'))
E RuntimeError: Error opening 'Temp\\tmpcd1ldlz6\\assets\\whitenoise.mp3': File contains data in an unknown format.
Anaconda3\lib\site-packages\soundfile.py:1357: RuntimeError
______________________________________ TestFunctionalFiltering.test_lfilter_gpu _______________________________________
self = <test_functional_filtering.TestFunctionalFiltering testMethod=test_lfilter_gpu>
def test_lfilter_gpu(self):
if torch.cuda.is_available():
filepath = os.path.join(self.test_dirpath, "assets", "whitenoise.mp3")
> waveform, _ = torchaudio.load(filepath, normalization=True)
test_functional_filtering.py:103:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
..\torchaudio\__init__.py:86: in load
filetype=filetype,
..\torchaudio\_soundfile_backend.py:86: in load
filepath, frames=num_frames, start=offset, dtype="float32", always_2d=True
Anaconda3\lib\site-packages\soundfile.py:257: in read
subtype, endian, format, closefd) as f:
Anaconda3\lib\site-packages\soundfile.py:629: in __init__
self._file = self._open(file, mode_int, closefd)
Anaconda3\lib\site-packages\soundfile.py:1184: in _open
"Error opening {0!r}: ".format(self.name))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
err = 21
prefix = "Error opening 'Temp\\\\tmpcd1ldlz6\\\\assets\\\\whitenoise.mp3': "
def _error_check(err, prefix=""):
"""Pretty-print a numerical error code if there is an error."""
if err != 0:
err_str = _snd.sf_error_number(err)
> raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace'))
E RuntimeError: Error opening 'Temp\\tmpcd1ldlz6\\assets\\whitenoise.mp3': File contains data in an unknown format.
Anaconda3\lib\site-packages\soundfile.py:1357: RuntimeError
________________________________________ TestFunctionalFiltering.test_lowpass _________________________________________
self = <test_functional_filtering.TestFunctionalFiltering testMethod=test_lowpass>
def test_lowpass(self):
"""
Test biquad lowpass filter, compare to SoX implementation
"""
CUTOFF_FREQ = 3000
noise_filepath = os.path.join(self.test_dirpath, "assets", "whitenoise.mp3")
> E = torchaudio.sox_effects.SoxEffectsChain()
test_functional_filtering.py:120:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
..\torchaudio\sox_effects.py:94: in __init__
self.EFFECTS_AVAILABLE = set(effect_names())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
@wraps(func)
def wrapper(*args, **kwargs):
if get_audio_backend() not in backends:
> raise RuntimeError("Function {} requires backend to be one of {}.".format(func.__name__, backends))
E RuntimeError: Function effect_names requires backend to be one of ['sox'].
..\torchaudio\_backend.py:51: RuntimeError
_________________________________ TestFunctionalFiltering.test_perf_biquad_filtering __________________________________
self = <test_functional_filtering.TestFunctionalFiltering testMethod=test_perf_biquad_filtering>
def test_perf_biquad_filtering(self):
fn_sine = os.path.join(self.test_dirpath, "assets", "whitenoise.mp3")
b0 = 0.4
b1 = 0.2
b2 = 0.9
a0 = 0.7
a1 = 0.2
a2 = 0.6
# SoX method
> E = torchaudio.sox_effects.SoxEffectsChain()
test_functional_filtering.py:184:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
..\torchaudio\sox_effects.py:94: in __init__
self.EFFECTS_AVAILABLE = set(effect_names())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
@wraps(func)
def wrapper(*args, **kwargs):
if get_audio_backend() not in backends:
> raise RuntimeError("Function {} requires backend to be one of {}.".format(func.__name__, backends))
E RuntimeError: Function effect_names requires backend to be one of ['sox'].
..\torchaudio\_backend.py:51: RuntimeError
___________________________________________ Test_KaldiIO.test_read_mat_ark ____________________________________________
self = <test_kaldi_io.Test_KaldiIO testMethod=test_read_mat_ark>
def test_read_mat_ark(self):
> self._test_helper("mat.ark", [self.data1, self.data2], kio.read_mat_ark, torch.float32)
test_kaldi_io.py:36:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_kaldi_io.py:23: in _test_helper
for key, vec in fn(test_filepath):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_or_fd = 'Temp\\tmp5suf2esd\\assets\\mat.ark'
def read_mat_ark(file_or_fd):
r"""Create generator of (key,matrix<float32/float64>) tuples, which reads from the ark file/stream.
Args:
file_or_fd (str/FileDescriptor): ark, gzipped ark, pipe or opened file descriptor
Returns:
Generator[str, torch.Tensor]: The string is the key and the tensor is the matrix read from file
Example
>>> # read ark to a 'dictionary'
>>> d = { u:d for u,d in torchaudio.kaldi_io.read_mat_ark(file) }
"""
> return _convert_method_output_to_tensor(file_or_fd, kaldi_io.read_mat_ark)
E NameError: name 'kaldi_io' is not defined
..\torchaudio\kaldi_io.py:127: NameError
_________________________________________ Test_KaldiIO.test_read_vec_flt_ark __________________________________________
self = <test_kaldi_io.Test_KaldiIO testMethod=test_read_vec_flt_ark>
def test_read_vec_flt_ark(self):
> self._test_helper("vec_flt.ark", self.data1, kio.read_vec_flt_ark, torch.float32)
test_kaldi_io.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_kaldi_io.py:23: in _test_helper
for key, vec in fn(test_filepath):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_or_fd = 'Temp\\tmp5suf2esd\\assets\\vec_flt.ark'
def read_vec_flt_ark(file_or_fd):
r"""Create generator of (key,vector<float32/float64>) tuples, which reads from the ark file/stream.
Args:
file_or_fd (str/FileDescriptor): ark, gzipped ark, pipe or opened file descriptor
Returns:
Generator[str, torch.Tensor]: The string is the key and the tensor is the vector read from file
Example
>>> # read ark to a 'dictionary'
>>> d = { u:d for u,d in torchaudio.kaldi_io.read_vec_flt_ark(file) }
"""
> return _convert_method_output_to_tensor(file_or_fd, kaldi_io.read_vec_flt_ark)
E NameError: name 'kaldi_io' is not defined
..\torchaudio\kaldi_io.py:95: NameError
_________________________________________ Test_KaldiIO.test_read_vec_int_ark __________________________________________
self = <test_kaldi_io.Test_KaldiIO testMethod=test_read_vec_int_ark>
def test_read_vec_int_ark(self):
> self._test_helper("vec_int.ark", self.data1, kio.read_vec_int_ark, torch.int32)
test_kaldi_io.py:30:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_kaldi_io.py:23: in _test_helper
for key, vec in fn(test_filepath):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_or_fd = 'Temp\\tmp5suf2esd\\assets\\vec_int.ark'
def read_vec_int_ark(file_or_fd):
r"""Create generator of (key,vector<int>) tuples, which reads from the ark file/stream.
Args:
file_or_fd (str/FileDescriptor): ark, gzipped ark, pipe or opened file descriptor
Returns:
Generator[str, torch.Tensor]: The string is the key and the tensor is the vector read from file
Example
>>> # read ark to a 'dictionary'
>>> d = { u:d for u,d in torchaudio.kaldi_io.read_vec_int_ark(file) }
"""
# Requires convert_contiguous to be True because elements from int32 vector are
# sored in tuples: (sizeof(int32), value) so strides are (5,) instead of (4,) which will throw an error
# in from_numpy as it expects strides to be a multiple of 4 (int32).
> return _convert_method_output_to_tensor(file_or_fd, kaldi_io.read_vec_int_ark, convert_contiguous=True)
E NameError: name 'kaldi_io' is not defined
..\torchaudio\kaldi_io.py:63: NameError
_______________________________________________ Tester.test_batch_mulaw _______________________________________________
self = <test_transforms.Tester testMethod=test_batch_mulaw>
def test_batch_mulaw(self):
> waveform, sample_rate = torchaudio.load(self.test_filepath) # (2, 278756), 44100
test_transforms.py:399:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
..\torchaudio\__init__.py:86: in load
filetype=filetype,
..\torchaudio\_soundfile_backend.py:86: in load
filepath, frames=num_frames, start=offset, dtype="float32", always_2d=True
Anaconda3\lib\site-packages\soundfile.py:257: in read
subtype, endian, format, closefd) as f:
Anaconda3\lib\site-packages\soundfile.py:629: in __init__
self._file = self._open(file, mode_int, closefd)
Anaconda3\lib\site-packages\soundfile.py:1184: in _open
"Error opening {0!r}: ".format(self.name))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
err = 21
prefix = "Error opening 'Temp\\\\tmp15mvx9o4\\\\assets\\\\steam-train-whistle-daniel_simon.mp3': "
def _error_check(err, prefix=""):
"""Pretty-print a numerical error code if there is an error."""
if err != 0:
err_str = _snd.sf_error_number(err)
> raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace'))
E RuntimeError: Error opening 'Temp\\tmp15mvx9o4\\assets\\steam-train-whistle-daniel_simon.mp3': File contains data in an unknown format.
Anaconda3\lib\site-packages\soundfile.py:1357: RuntimeError
____________________________________________ Tester.test_batch_spectrogram ____________________________________________
self = <test_transforms.Tester testMethod=test_batch_spectrogram>
def test_batch_spectrogram(self):
> waveform, sample_rate = torchaudio.load(self.test_filepath)
test_transforms.py:425:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
..\torchaudio\__init__.py:86: in load
filetype=filetype,
..\torchaudio\_soundfile_backend.py:86: in load
filepath, frames=num_frames, start=offset, dtype="float32", always_2d=True
Anaconda3\lib\site-packages\soundfile.py:257: in read
subtype, endian, format, closefd) as f:
Anaconda3\lib\site-packages\soundfile.py:629: in __init__
self._file = self._open(file, mode_int, closefd)
Anaconda3\lib\site-packages\soundfile.py:1184: in _open
"Error opening {0!r}: ".format(self.name))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
err = 21
prefix = "Error opening 'Temp\\\\tmp15mvx9o4\\\\assets\\\\steam-train-whistle-daniel_simon.mp3': "
def _error_check(err, prefix=""):
"""Pretty-print a numerical error code if there is an error."""
if err != 0:
err_str = _snd.sf_error_number(err)
> raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace'))
E RuntimeError: Error opening 'Temp\\tmp15mvx9o4\\assets\\steam-train-whistle-daniel_simon.mp3': File contains data in an unknown format.
Anaconda3\lib\site-packages\soundfile.py:1357: RuntimeError
__________________________________________________ Tester.test_mel2 ___________________________________________________
self = <test_transforms.Tester testMethod=test_mel2>
def test_mel2(self):
top_db = 80.
s2db = transforms.AmplitudeToDB('power', top_db)
waveform = self.waveform.clone() # (1, 16000)
waveform_scaled = self.scale(waveform) # (1, 16000)
mel_transform = transforms.MelSpectrogram()
# check defaults
spectrogram_torch = s2db(mel_transform(waveform_scaled)) # (1, 128, 321)
self.assertTrue(spectrogram_torch.dim() == 3)
self.assertTrue(spectrogram_torch.ge(spectrogram_torch.max() - top_db).all())
self.assertEqual(spectrogram_torch.size(1), mel_transform.n_mels)
# check correctness of filterbank conversion matrix
self.assertTrue(mel_transform.mel_scale.fb.sum(1).le(1.).all())
self.assertTrue(mel_transform.mel_scale.fb.sum(1).ge(0.).all())
# check options
kwargs = {'window_fn': torch.hamming_window, 'pad': 10, 'win_length': 500,
'hop_length': 125, 'n_fft': 800, 'n_mels': 50}
mel_transform2 = transforms.MelSpectrogram(**kwargs)
spectrogram2_torch = s2db(mel_transform2(waveform_scaled)) # (1, 50, 513)
self.assertTrue(spectrogram2_torch.dim() == 3)
self.assertTrue(spectrogram_torch.ge(spectrogram_torch.max() - top_db).all())
self.assertEqual(spectrogram2_torch.size(1), mel_transform2.n_mels)
self.assertTrue(mel_transform2.mel_scale.fb.sum(1).le(1.).all())
self.assertTrue(mel_transform2.mel_scale.fb.sum(1).ge(0.).all())
# check on multi-channel audio
> x_stereo, sr_stereo = torchaudio.load(self.test_filepath) # (2, 278756), 44100
test_transforms.py:160:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
..\torchaudio\__init__.py:86: in load
filetype=filetype,
..\torchaudio\_soundfile_backend.py:86: in load
filepath, frames=num_frames, start=offset, dtype="float32", always_2d=True
Anaconda3\lib\site-packages\soundfile.py:257: in read
subtype, endian, format, closefd) as f:
Anaconda3\lib\site-packages\soundfile.py:629: in __init__
self._file = self._open(file, mode_int, closefd)
Anaconda3\lib\site-packages\soundfile.py:1184: in _open
"Error opening {0!r}: ".format(self.name))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
err = 21
prefix = "Error opening 'Temp\\\\tmp15mvx9o4\\\\assets\\\\steam-train-whistle-daniel_simon.mp3': "
def _error_check(err, prefix=""):
"""Pretty-print a numerical error code if there is an error."""
if err != 0:
err_str = _snd.sf_error_number(err)
> raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace'))
E RuntimeError: Error opening 'Temp\\tmp15mvx9o4\\assets\\steam-train-whistle-daniel_simon.mp3': File contains data in an unknown format.
Anaconda3\lib\site-packages\soundfile.py:1357: RuntimeError
================================= 16 failed, 50 passed, 4 skipped, 17 error in 33.46s =================================
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment