audeering / opensmile-python

Python package for openSMILE
https://audeering.github.io/opensmile-python/
Other
240 stars 32 forks source link

Multiprocessing with num_workers>1 fails with pickle errors #104

Closed hagenw closed 5 months ago

hagenw commented 5 months ago

When running the tests in the current main we get:

$ python -m pytest -x
...
TypeError: cannot pickle 'mappingproxy' object

If I inspect the problem it uses multiprocessing=True and num_workers=5. The error does not appear if I use multiprocessing=False or num_workers=1.

@frankenjoe seems like they changed something in Python?

frankenjoe commented 5 months ago

I guess though. Bu you have not upgraded the Python version, so why does the error suddenly appear?

hagenw commented 5 months ago

That is a very good question. I repeated the test locally with Python 3.8 and it fails with the same error message. So I guess, it must be some interaction with another package.

frankenjoe commented 5 months ago

Maybe try to downgrade audinterface and/or audobject as a start?

hagenw commented 5 months ago

Good point the error was introduced with audinterface 1.2.0. But there weren't that much changes to it: https://audeering.github.io/audinterface/changelog.html#version-1-2-0-2024-03-21

hagenw commented 5 months ago

The problem was that there were no tests for multiprocessing=True inside audinterface, so we didn't encounter the error there.

hagenw commented 5 months ago

Turns out multiprocessing=True was also broken for earlier versions of audinterface (just the error message was differrent), compare https://github.com/audeering/audinterface/pull/163

hagenw commented 5 months ago

This is fixed with release 1.2.1 of audinterface