You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/content/ml-utility-loss/ml_utility_loss/loss_learning/estimator/process.py in
4 from ...util import stack_samples, stack_sample_dicts
5 from torch.nn.utils import clip_grad_norm_
----> 6 from torchmetrics import MeanSquaredError as MSE, MeanAbsoluteError as MAE, MeanAbsolutePercentageError as MAPE
7
8 RMSE = MSE(squared=False)
/usr/local/lib/python3.10/dist-packages/torchmetrics/init.py in
12 _PROJECT_ROOT = os.path.dirname(_PACKAGE_ROOT)
13
---> 14 from torchmetrics import functional # noqa: E402
15 from torchmetrics.aggregation import ( # noqa: E402
16 CatMetric,
/usr/local/lib/python3.10/dist-packages/torchmetrics/functional/init.py in
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
---> 14 from torchmetrics.functional.audio._deprecated import _permutation_invariant_training as permutation_invariant_training
15 from torchmetrics.functional.audio._deprecated import _pit_permutate as pit_permutate
16 from torchmetrics.functional.audio._deprecated import (
/usr/local/lib/python3.10/dist-packages/torchmetrics/functional/audio/init.py in
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
---> 14 from torchmetrics.functional.audio.pit import permutation_invariant_training, pit_permutate
15 from torchmetrics.functional.audio.sdr import (
16 scale_invariant_signal_distortion_ratio,
/usr/local/lib/python3.10/dist-packages/torchmetrics/utilities/init.py in
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
---> 14 from torchmetrics.utilities.checks import check_forward_full_state_property
15 from torchmetrics.utilities.data import (
16 dim_zero_cat,
/usr/local/lib/python3.10/dist-packages/torch/_ops.py in load_library(self, path)
571 # static (global) initialization code in order to register custom
572 # operators with the JIT.
--> 573 ctypes.CDLL(path)
574 self.loaded_libraries.add(path)
575
/usr/lib/python3.10/ctypes/init.py in init(self, name, mode, handle, use_errno, use_last_error, winmode)
372
373 if handle is None:
--> 374 self._handle = _dlopen(self._name, mode)
375 else:
376 self._handle = handle
I was just trying to import MSE, MAE, and MAPE
from torchmetrics import MeanSquaredError as MSE, MeanAbsoluteError as MAE, MeanAbsolutePercentageError as MAPE
Expected behavior
It imported MSE, MAE, and MAPE, preferably without requiring torchaudio.
Environment
Google Colab
Python 3.10.12
torch==1.13.1
torchmetrics==1.2.0
torchaudio==2.1.0+cu118
Additional context
I can't upgrade torch to latest version due to a package I need requires torch 1.x
The text was updated successfully, but these errors were encountered:
Hi! thanks for your contribution!, great first issue!
R-N
changed the title
OSError libtorchaudio.so: undefined symbol: _ZN3c104cuda20CUDACachingAllocator9allocatorE
OSError libtorchaudio.so: undefined symbol: _ZN3c104cuda20CUDACachingAllocator9allocatorE when importing MSE, MAE, or MAPE
Oct 22, 2023
🐛 Bug
I was just trying to import MSE, MAE, and MAPE but it errors. Weird that it has to import torchaudio when I'm not importing audio metrics?
OSError: /usr/local/lib/python3.10/dist-packages/torchaudio/lib/libtorchaudio.so: undefined symbol: _ZN3c104cuda20CUDACachingAllocator9allocatorE
/content/ml-utility-loss/ml_utility_loss/loss_learning/estimator/process.py in
4 from ...util import stack_samples, stack_sample_dicts
5 from torch.nn.utils import clip_grad_norm_
----> 6 from torchmetrics import MeanSquaredError as MSE, MeanAbsoluteError as MAE, MeanAbsolutePercentageError as MAPE
7
8 RMSE = MSE(squared=False)
/usr/local/lib/python3.10/dist-packages/torchmetrics/init.py in
12 _PROJECT_ROOT = os.path.dirname(_PACKAGE_ROOT)
13
---> 14 from torchmetrics import functional # noqa: E402
15 from torchmetrics.aggregation import ( # noqa: E402
16 CatMetric,
/usr/local/lib/python3.10/dist-packages/torchmetrics/functional/init.py in
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
---> 14 from torchmetrics.functional.audio._deprecated import _permutation_invariant_training as permutation_invariant_training
15 from torchmetrics.functional.audio._deprecated import _pit_permutate as pit_permutate
16 from torchmetrics.functional.audio._deprecated import (
/usr/local/lib/python3.10/dist-packages/torchmetrics/functional/audio/init.py in
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
---> 14 from torchmetrics.functional.audio.pit import permutation_invariant_training, pit_permutate
15 from torchmetrics.functional.audio.sdr import (
16 scale_invariant_signal_distortion_ratio,
/usr/local/lib/python3.10/dist-packages/torchmetrics/functional/audio/pit.py in
20 from typing_extensions import Literal
21
---> 22 from torchmetrics.utilities import rank_zero_warn
23 from torchmetrics.utilities.imports import _SCIPY_AVAILABLE
24
/usr/local/lib/python3.10/dist-packages/torchmetrics/utilities/init.py in
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
---> 14 from torchmetrics.utilities.checks import check_forward_full_state_property
15 from torchmetrics.utilities.data import (
16 dim_zero_cat,
/usr/local/lib/python3.10/dist-packages/torchmetrics/utilities/checks.py in
23 from torch import Tensor
24
---> 25 from torchmetrics.metric import Metric
26 from torchmetrics.utilities.data import select_topk, to_onehot
27 from torchmetrics.utilities.enums import DataType
/usr/local/lib/python3.10/dist-packages/torchmetrics/metric.py in
28 from torch.nn import Module
29
---> 30 from torchmetrics.utilities.data import (
31 _flatten,
32 _squeeze_if_scalar,
/usr/local/lib/python3.10/dist-packages/torchmetrics/utilities/data.py in
20
21 from torchmetrics.utilities.exceptions import TorchMetricsUserWarning
---> 22 from torchmetrics.utilities.imports import _TORCH_GREATER_EQUAL_1_12, _XLA_AVAILABLE
23 from torchmetrics.utilities.prints import rank_zero_warn
24
/usr/local/lib/python3.10/dist-packages/torchmetrics/utilities/imports.py in
48 _GAMMATONE_AVAILABEL: bool = package_available("gammatone")
49 _TORCHAUDIO_AVAILABEL: bool = package_available("torchaudio")
---> 50 _TORCHAUDIO_GREATER_EQUAL_0_10: Optional[bool] = compare_version("torchaudio", operator.ge, "0.10.0")
51 _SACREBLEU_AVAILABLE: bool = package_available("sacrebleu")
52 _REGEX_AVAILABLE: bool = package_available("regex")
/usr/local/lib/python3.10/dist-packages/lightning_utilities/core/imports.py in compare_version(package, op, version, use_base_version)
71 """
72 try:
---> 73 pkg = importlib.import_module(package)
74 except (ImportError, pkg_resources.DistributionNotFound):
75 return False
/usr/lib/python3.10/importlib/init.py in import_module(name, package)
124 break
125 level += 1
--> 126 return _bootstrap._gcd_import(name[level:], package, level)
127
128
/usr/local/lib/python3.10/dist-packages/torchaudio/init.py in
----> 1 from . import ( # noqa: F401
2 _extension,
3 compliance,
4 datasets,
5 functional,
/usr/local/lib/python3.10/dist-packages/torchaudio/_extension/init.py in
43 _IS_ALIGN_AVAILABLE = False
44 if _IS_TORCHAUDIO_EXT_AVAILABLE:
---> 45 _load_lib("libtorchaudio")
46
47 import torchaudio.lib._torchaudio # noqa
/usr/local/lib/python3.10/dist-packages/torchaudio/_extension/utils.py in _load_lib(lib)
62 if not path.exists():
63 return False
---> 64 torch.ops.load_library(path)
65 torch.classes.load_library(path)
66 return True
/usr/local/lib/python3.10/dist-packages/torch/_ops.py in load_library(self, path)
571 # static (global) initialization code in order to register custom
572 # operators with the JIT.
--> 573 ctypes.CDLL(path)
574 self.loaded_libraries.add(path)
575
/usr/lib/python3.10/ctypes/init.py in init(self, name, mode, handle, use_errno, use_last_error, winmode)
372
373 if handle is None:
--> 374 self._handle = _dlopen(self._name, mode)
375 else:
376 self._handle = handle
OSError: /usr/local/lib/python3.10/dist-packages/torchaudio/lib/libtorchaudio.so: undefined symbol: _ZN3c104cuda20CUDACachingAllocator9allocatorE
To Reproduce
I was just trying to import MSE, MAE, and MAPE
from torchmetrics import MeanSquaredError as MSE, MeanAbsoluteError as MAE, MeanAbsolutePercentageError as MAPEExpected behavior
It imported MSE, MAE, and MAPE, preferably without requiring torchaudio.
Environment
Google Colab
Python 3.10.12
torch==1.13.1
torchmetrics==1.2.0
torchaudio==2.1.0+cu118
Additional context
I can't upgrade torch to latest version due to a package I need requires torch 1.x
The text was updated successfully, but these errors were encountered: