Giter VIP home page Giter VIP logo

Comments (5)

chausner-audeering avatar chausner-audeering commented on May 30, 2024 1

We have solved this issue in an internal version and will publish a patch release in January that will include this fix.

from opensmile.

chausner-audeering avatar chausner-audeering commented on May 30, 2024

Does this happen every time when you attempt to use multiple threads or only sometimes? Does it happen with only specific config files? What would be the best approach to reproduce it?

In general, the SMILEapi should be fully thread-safe as long as you only use separate instances in each thread.

from opensmile.

agkphysics avatar agkphysics commented on May 30, 2024

@chausner-audeering I have also encountered this issue when trying to use multiple threads with the python library. It seems to occur randomly, which might indicate some kind of race condition. But I have found the issue with all of the standard configs and the IS13 config I adapted.

I have some test code below which is hopefully reproducible.

from threading import Thread

import numpy as np
import opensmile

signals = np.random.random_sample(size=(2, 80000)).astype(np.float32)

def test(i):
    smile = opensmile.Smile(logfile=f"smile_{i}.log")
    smile(signals[i], 16000)
    del smile

threads = [Thread(target=test, args=(i,)) for i in range(2)]
for t in threads:
    t.start()
for t in threads:
    t.join()

When I run this code, it sometimes suceeds, sometimes fails with a segmentation fault, and sometimes raises the "Code 6" exception mentioned above. Sometimes the error occurs during Smile initialisation and other times it occurs during processing a signal.

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "test.py", line 10, in test
    smile = opensmile.Smile(logfile=f"smile_{i}.log")
  File "/home/akee511/src/emotion/.venv/lib/python3.8/site-packages/audobject/core/decorator.py", line 109, in wrapper
    func(self, *args, **kwargs)
  File "/home/akee511/src/emotion/.venv/lib/python3.8/site-packages/audeer/core/utils.py", line 174, in new_func
    return func(*args, **kwargs)
  File "/home/akee511/src/emotion/.venv/lib/python3.8/site-packages/opensmile/core/smile.py", line 173, in __init__
    self._feature_names(),
  File "/home/akee511/src/emotion/.venv/lib/python3.8/site-packages/opensmile/core/smile.py", line 333, in _feature_names
    smile = self._smile(options=options)
  File "/home/akee511/src/emotion/.venv/lib/python3.8/site-packages/opensmile/core/smile.py", line 424, in _smile
    smile.initialize(
  File "/home/akee511/src/emotion/.venv/lib/python3.8/site-packages/opensmile/core/SMILEapi.py", line 240, in initialize
    self._check_smile_result(smileapi.smile_initialize(self._smileobj,
  File "/home/akee511/src/emotion/.venv/lib/python3.8/site-packages/opensmile/core/SMILEapi.py", line 478, in _check_smile_result
    raise OpenSmileException(result)
opensmile.core.SMILEapi.OpenSmileException: Code: 6

When looking at the log files, one of them produces no errors but the other produces the error:

[ 26.11.2021 - 17:18:09 ]
    (ERR) [1] configManager: ConfigType::findFieldH: referenced base field with name 'Extremes.max' not found!
[ 26.11.2021 - 17:18:09 ]
    (ERR) [1] configManager: (line 29) cFileConfigReader::getInstance: unknown field type (name 'Extremes.max') (in ConfigType 'cFunctionals') ty=-1

smile_0.log
smile_1.log

from opensmile.

chausner-audeering avatar chausner-audeering commented on May 30, 2024

@agkphysics Thanks a lot, that's very useful information.

from opensmile.

chausner-audeering avatar chausner-audeering commented on May 30, 2024

Version 3.0.1 has been released with the fix.

from opensmile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.