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

Different feature values while using "import torch" ! #35

Open
DrewdropLife opened this issue Mar 25, 2024 · 1 comment
Open

Different feature values while using "import torch" ! #35

DrewdropLife opened this issue Mar 25, 2024 · 1 comment

Comments

@DrewdropLife
Copy link

DrewdropLife commented Mar 25, 2024

for example

import audioflux
output1 = audioflux.mel_spectrogram(waveform, num=80, radix2_exp=10, samplate=16000)
import torch
import audioflux
output2 = audioflux.mel_spectrogram(waveform, num=80, radix2_exp=10, samplate=16000)

I finally found out that the output1 and output2 is too different just because "import torch", if this is a bug? It'll call difference while inferencing with ONNX (without using torch to extract features).

@DrewdropLife DrewdropLife changed the title Different values while use "import torch" Different feature values while using "import torch" ! Mar 25, 2024
@wtq2255
Copy link
Member

wtq2255 commented Jul 25, 2024

@DrewdropLife It sounds like you're encountering a compatibility issue related to the use of Intel Math Kernel Library (MKL) and OpenMP when using various Python scientific computing libraries like PyTorch, TensorFlow, etc. These libraries often depend on MKL for optimized performance, and MKL in turn relies on OpenMP for parallel acceleration.

The issue arises because only one instance of OpenMP can exist within the same process. When different libraries are linked to different versions or locations of libomp (the OpenMP library), conflicts can occur, leading to errors or unexpected behavior during inference or execution.

To resolve this, it's recommended to ensure that all libraries are linked to the same version and location of libomp. This typically involves adjusting environment variables or linking paths to ensure consistency across the libraries. Failing to do so can result in slower performance or even unreliable results due to conflicting configurations of MKL and OpenMP.

If you're using Conda environments, you can manage these dependencies more easily by ensuring that all relevant packages are installed in the same environment, or by explicitly configuring environment variables to point to the correct locations for libomp.

If you need further assistance with specific configurations or troubleshooting steps, feel free to ask!

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

2 participants