Describe the bug
Here is check:
|
if version.parse(torch.__version__) <= version.parse("1.6.0"): |
I don't understand the meaning of this because you have torch>=1.9 in the requirements
So this if seems useless
Expected behaviour
I expected that there would be no such check, because defined to support torch>=1.9.0
To Reproduce
Plus it is became a problem for scripting Fbank (my local error):
torch.jit.frontend.UnsupportedNodeError: try blocks aren't supported:
File "/opt/conda/lib/python3.9/site-packages/packaging/version.py", line 48
a valid PEP 440 version or a legacy version.
"""
try:
~~~ <--- HERE
return Version(version)
except InvalidVersion:
because version is using try-catch
and error in colab:
import torch
from speechbrain.lobes.features import Fbank
fbank = Fbank(sample_rate=8000, n_fft=512, n_mels=64, left_frames=0, right_frames=0, deltas=False)
torch.jit.script(fbank)
RuntimeError:
'__torch__.packaging.version.Version (of Python compilation unit at: 0x6dd2a30)' object has no attribute or method '_regex'. '_regex' is defined as a class attribute which currently is not supported. Consider converting this to an instance attribute.:
File "/usr/local/lib/python3.9/dist-packages/packaging/version.py", line 195
# Validate the version and parse it into pieces
match = self._regex.search(version)
~~~~~~~~~~~ <--- HERE
if not match:
raise InvalidVersion(f"Invalid version: '{version}'")
'Version.__init__' is being compiled since it was called from '__torch__.packaging.version.Version'
File "/usr/local/lib/python3.9/dist-packages/packaging/version.py", line 43
def parse(version: str) -> "Version":
~~~~~~~~ <--- HERE
"""Parse the given version string.
'__torch__.packaging.version.Version' is being compiled since it was called from 'parse'
File "/usr/local/lib/python3.9/dist-packages/packaging/version.py", line 43
def parse(version: str) -> "Version":
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""Parse the given version string.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> parse('1.0.dev1')
~~~~~~~~~~~~~~~~~~~~~
<Version('1.0.dev1')>
~~~~~~~~~~~~~~~~~~~~~
:param version: The version string to parse.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:raises InvalidVersion: When the version string is not a valid version.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
~~~
return Version(version)
~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
'parse' is being compiled since it was called from 'STFT.forward'
File "/usr/local/lib/python3.9/dist-packages/speechbrain/processing/features.py", line 148
x = x.reshape(or_shape[0] * or_shape[2], or_shape[1])
if version.parse(torch.__version__) <= version.parse("1.6.0"):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
stft = torch.stft(
x,
Without this check, the model scripts well
Versions
speechbrain=0.5.13
torch=1.13.1+cu116
Relevant log output
No response
Additional context
No response
Describe the bug
Here is check:
speechbrain/speechbrain/processing/features.py
Line 148 in beec862
I don't understand the meaning of this because you have
torch>=1.9in the requirementsspeechbrain/setup.py
Line 40 in beec862
So this if seems useless
Expected behaviour
I expected that there would be no such check, because defined to support
torch>=1.9.0To Reproduce
Plus it is became a problem for scripting Fbank (my local error):
because version is using try-catch
and error in colab:
Without this check, the model scripts well
Versions
speechbrain=0.5.13
torch=1.13.1+cu116
Relevant log output
No response
Additional context
No response