-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Ubuntu 22.04 Python 3.11 [asr]: multiple errors dataclasses ValueError: mutable default * for field * is not allowed: use default_factory
#7166
Comments
dataclasses ValueError: mutable default * for field * is not allowed: use default_factory
Seems to be a similar to #7002 |
Interesting. The fix is easy but needs to be applied to basically every single place that has this constructor for our adapter configs. Let me see if I can update it. But no guarantees on how soon fixes will come in main. |
Looking forward to it @titu1994 ! Thanks 😃 |
@titu1994 I was looking to use NeMo speaker diarization with Python 3.11 and hit this dataclass issue. I patched everything involved in the specific code paths I needed: lmnt-com@d89acf9 I was using the neural diarizer as described in https://github.com/NVIDIA/NeMo/tree/main/examples/speaker_tasks/diarization I'd be happy to upstream this if it's helpful. I haven't checked whether this is backwards compatible for earlier python/dataclass versions, do you know? For reference, what led me to this issue, though it's duplicative to the above discussion: |
@shaper Thanks for sharing. For brevity, you don't really need a
You can just do
It's only needed when you do pass parameter(s), like
|
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
I have the same issue. @tango4j suggested using one of the models from https://huggingface.co/spaces/hf-audio/open_asr_leaderboard, but I cannot import nemo.collections.asr:
For documentation (I had to search in the provided links): An alternative to default_factory would be to use frozen dataclasses, but I don't know whether in this code base the configs are used as mutable objects or not. |
You need to update to NeMo 1.20, omegaconf did a fix that should resolve this |
I have NeMo 1.20.0.
|
Hmm ok I'll take a look |
Sorry for the long delay, this should be fixed now. Let me know if there are remaining data classes that I need to fix |
@titu1994 Running
|
Describe the bug
After installing latest stable
1.19.1
from pipI, or the latest current commit with[asr]
extras, I'm getting this error fromhydra-core==1.2.0
when trying to importnemo.collections.asr
:If I then manually upgrade
hydra-core
to the current latest (1.3.2
), I get similar errors fromnemo-toolkit
:It's easy to fix with a patch like this:
However then another error of the kind comes up:
This can also be fixed accordingly, but all in all, it appears these issues are pretty common in the code base.
Looks like NeMo isn't Python 3.11 ready, at least the
asr
collection.Steps/Code to reproduce bug
With Python 3.11
nemo-toolkit[asr]
either 1.19.1, or current HEAD from git (b498d43)import nemo.collections.asr
Expected behavior
Import
nemo.collections.asr
without errorsEnvironment overview (please complete the following information)
pip install nemo-toolkit==1.19.1
or from source b498d43Environment details
The text was updated successfully, but these errors were encountered: