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

About opensmile-python multithreading #41

Open
ykingliu opened this issue Aug 25, 2021 · 12 comments
Open

About opensmile-python multithreading #41

ykingliu opened this issue Aug 25, 2021 · 12 comments

Comments

@ykingliu
Copy link

ykingliu commented Aug 25, 2021

Hi, is opensmile-python possible to use multithreading? how to use it? i encountered some problems when i used it

return code: 6 configuration could not be loaded

@eracube
Copy link

eracube commented Nov 24, 2021

I am facing the same issue. Could anyone please help?

Issue:
OpenSmile Code: 6

@frankenjoe
Copy link
Collaborator

Unfortunately, support for multi-threading is still blocked by audeering/opensmile#20. You can use multi-processing, though.

@chausner-audeering
Copy link

If multi-threading is broken or unreliable at the moment, would it make sense to remove the option from the library for now or throw an exception if it is set?

@frankenjoe
Copy link
Collaborator

We have removed the option to select multi-threading and automatically switch to multi-processing when multiple workers are set. But it may still happen that a user writes own code where she uses the same instance of Smile in multiple threads.

@eracube
Copy link

eracube commented Nov 25, 2021

I am using opensmile with dask, and whether I use multi-processing or multi-threading, I get the same error. Note: I am creating a different instance of Smile for each file.

@frankenjoe
Copy link
Collaborator

Did you try?

smile = Smile(..., num_workers=5)
smile.process_files(files)

@eracube
Copy link

eracube commented Nov 26, 2021

Thank you for your reply. I need to use process_signal instead of files (I am not reading files from the disk). Is there a way to disable multiprocessing all together? I tried the following but it doesn't seem to work.

smile = Smile(feature_set, feature_level) smile.process.multithreading = False

@frankenjoe
Copy link
Collaborator

Is there a way to disable multiprocessing all together?

It's off by default since the default value for num_workers is 1.

@eracube
Copy link

eracube commented Dec 17, 2021

Thank you for this, @frankenjoe. I am running smile.process_signal(array, sample_rate) on multiple processors/threads as a test on a single machine, and I see the following error that occurs in random.

[ 16.12.2021 - 13:54:20 ]
(MSG) [2] SMILEapi: openSMILE starting!
[ 16.12.2021 - 13:54:20 ]
(MSG) [2] SMILEapi: config file is: /venv/lib/python3.9/site-packages/opensmile/core/config/egemaps/v02/eGeMAPSv02.conf
[ 16.12.2021 - 13:54:20 ]
(MSG) [2] cComponentManager: successfully registered 103 component types.
[ 16.12.2021 - 13:54:20 ]
(ERR) [1] configManager: ConfigType::findFieldH: referenced base field with name 'Segments.maxNumSeg' not found!
[ 16.12.2021 - 13:54:20 ]
(ERR) [1] configManager: (line 48) cFileConfigReader::getInstance: unknown field type (name 'Segments.maxNumSeg') (in ConfigType 'cFunctionals') ty=-1

Is it a known bug, or I am doing something wrong?

@frankenjoe
Copy link
Collaborator

frankenjoe commented Dec 17, 2021

Yes, it's a known bug and requires a fix for audeering/opensmile#20

@agkphysics
Copy link

Now that audeering/opensmile#20 is fixed, can this update be propagated to the python module?

@frankenjoe
Copy link
Collaborator

@agkphysics it's now available with version 2.4.1. Just make sure to set num_workers>1 and multiprocessing=False.

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

5 participants