Skip to content

ValueError: mutable default <class 's3prl.upstream.roberta.roberta_model.EncDecBaseConfig'> for field encoder is not allowed: use default_factory #522

Open

Description

@haoyunlf

Hello, I have installed s3prl using the minimal installation pip install s3prl and this error occurs when I tried to import it import s3prl.hub as hub
image

Environment
Debian GNU/Linux 11
Python 3.11.5
torch 2.1.2
s3prl 0.4.13

Activity

  1. leo19941227 commented on Dec 21, 2023

    @leo19941227
    Member

    Hi @haoyunlf ,

    Thanks for reporting, it seems like a python version related to the newer 3.11.
    Since we only test the python version until 3.10.
    Could you verify if downgrading the python version help?

  2. haoyunlf commented on Dec 22, 2023

    @haoyunlf
    Author

    Hi @haoyunlf ,

    Thanks for reporting, it seems like a python version related to the newer 3.11. Since we only test the python version until 3.10. Could you verify if downgrading the python version help?

    Thank you! This problems is solved when I downgraded the Python version to 3.10.

  3. leo19941227 commented on Dec 22, 2023

    @leo19941227
    Member

    Cool! I will leave this issue open until we add support for 3.11

  4. ftshijt commented on Aug 20, 2024

    @ftshijt
    Collaborator

    Hi @leo19941227 , may I ask if there are plans on py3.11?

    We are facing some CI issues regarding the support with py3.11 on the same error mentioned in the issue (https://github.com/espnet/espnet/actions/runs/10461525936/job/28970044192?pr=5862). It would be probably simple to fix by setting default_class to the default config (I think the issue is from the original fairseq code actually...)

    Following is an example:

    # Original code
    encoder: EncDecBaseConfig = EncDecBaseConfig()
    
    # New code
    encoder: EncDecBaseConfig = field(default_factory=EncDecBaseConfig)
    

    I can help start a PR for it if you think it would be good. Thanks for your attention!

    Some references:

  5. leo19941227 commented on Aug 20, 2024

    @leo19941227
    Member

    Hi @ftshijt ,

    Thanks for pointing out the issue and the solution! I am good with the modification. Let's start the PR and I can merge it and publish a new Pypi now.

  6. ftshijt commented on Aug 20, 2024

    @ftshijt
    Collaborator

    Thanks for your timely response! I will start one after some local tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions