Retrieval-based-Voice-Conversion-WebUI icon indicating copy to clipboard operation
Retrieval-based-Voice-Conversion-WebUI copied to clipboard

use default_factory

Open supercraaazy opened this issue 1 year ago • 10 comments

Guys easy on me i am a beginner i followed all steps i receive this message 👍

File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/dataclasses.py", line 815, in _get_field raise ValueError(f'mutable default {type(f.default)} for field ' ValueError: mutable default <class 'fairseq.dataclass.configs.CommonConfig'> for field common is not allowed: use default_factory. i am mac user. any idea.

supercraaazy avatar Jun 07 '23 19:06 supercraaazy

maybe it's because the version of fairseq Our repo is tested in fairseq==0.12.2

RVC-Boss avatar Jun 08 '23 02:06 RVC-Boss

maybe it's because the version of fairseq Our repo is tested in fairseq==0.12.2

this is the same on i am using still the same error

supercraaazy avatar Jun 08 '23 16:06 supercraaazy

I have been trying to fix this by modifying fairseq to support python 3.11, but it does not seem to be working. See https://github.com/wtf-things/fairseq-311/commits/main and https://github.com/facebookresearch/fairseq/pull/5062.

File "/home/theo/.local/lib/python3.11/site-packages/fairseq/__init__.py", line 31, in <module>
    hydra_init()
  File "/home/theo/.local/lib/python3.11/site-packages/fairseq/dataclass/initialize.py", line 24, in hydra_init
    cs.store(name=k, node=v)
  File "/home/theo/.local/lib/python3.11/site-packages/hydra/core/config_store.py", line 85, in store
    cfg = OmegaConf.structured(node)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/theo/.local/lib/python3.11/site-packages/omegaconf/omegaconf.py", line 125, in structured
    return OmegaConf.create(obj, parent, flags)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/theo/.local/lib/python3.11/site-packages/omegaconf/omegaconf.py", line 178, in create
    return OmegaConf._create_impl(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/theo/.local/lib/python3.11/site-packages/omegaconf/omegaconf.py", line 900, in _create_impl
    format_and_raise(node=None, key=None, value=None, msg=str(e), cause=e)
  File "/home/theo/.local/lib/python3.11/site-packages/omegaconf/_utils.py", line 901, in format_and_raise
    _raise(ex, cause)
  File "/home/theo/.local/lib/python3.11/site-packages/omegaconf/_utils.py", line 799, in _raise
    raise ex.with_traceback(sys.exc_info()[2])  # set env var OC_CAUSE=1 for full trace
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/theo/.local/lib/python3.11/site-packages/omegaconf/omegaconf.py", line 896, in _create_impl
    raise ValidationError(
omegaconf.errors.ValidationError: Object of unsupported type: '_MISSING_TYPE'
    full_key:
    object_type=None

Am I doing something wrong? I downloaded the latest github release file and extracted it, then I ran

python3 -m pip install -r requirements.txt
python3 -m pip install git+https://github.com/wtf-things/fairseq-311/
python3 infer-web.py

theoparis avatar Jun 10 '23 08:06 theoparis

ok now after long time of using codes that may fix my issue. now i am getting this message :

Use Language: en_US common - <dataclasses._MISSING_TYPE object at 0x10e83fe80> Traceback (most recent call last): File "/Users/supercrazy/Downloads/Retrieval-based-Voice-Conversion-WebUI-main 2/infer-web.py", line 82, in from fairseq import checkpoint_utils File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/fairseq/init.py", line 31, in hydra_init() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/fairseq/dataclass/initialize.py", line 24, in hydra_init cs.store(name=k, node=v) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/hydra/core/config_store.py", line 85, in store cfg = OmegaConf.structured(node) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/omegaconf/omegaconf.py", line 125, in structured return OmegaConf.create(obj, parent, flags) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/omegaconf/omegaconf.py", line 178, in create return OmegaConf._create_impl( File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/omegaconf/omegaconf.py", line 900, in _create_impl format_and_raise(node=None, key=None, value=None, msg=str(e), cause=e) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/omegaconf/_utils.py", line 899, in format_and_raise _raise(ex, cause) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/omegaconf/_utils.py", line 797, in _raise raise ex.with_traceback(sys.exc_info()[2]) # set env var OC_CAUSE=1 for full trace File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/omegaconf/omegaconf.py", line 896, in _create_impl raise ValidationError( omegaconf.errors.ValidationError: Object of unsupported type: '_MISSING_TYPE' full_key: object_type=None

any idea?

supercraaazy avatar Jun 11 '23 12:06 supercraaazy

I am stuck here:

python3.11 infer-web.py

Traceback (most recent call last): File "/Retrieval-based-Voice-Conversion-WebUI-main/infer-web.py", line 26, in from fairseq import checkpoint_utils File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/fairseq/init.py", line 20, in from fairseq.distributed import utils as distributed_utils File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/fairseq/distributed/init.py", line 7, in from .fully_sharded_data_parallel import ( File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/fairseq/distributed/fully_sharded_data_parallel.py", line 10, in from fairseq.dataclass.configs import DistributedTrainingConfig File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/fairseq/dataclass/init.py", line 6, in from .configs import FairseqDataclass File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/fairseq/dataclass/configs.py", line 1104, in @dataclass ^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/dataclasses.py", line 1230, in dataclass return wrap(cls) ^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/dataclasses.py", line 1220, in wrap return _process_class(cls, init, repr, eq, order, unsafe_hash, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/dataclasses.py", line 958, in _process_class cls_fields.append(_get_field(cls, name, type, kw_only)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/dataclasses.py", line 815, in _get_field raise ValueError(f'mutable default {type(f.default)} for field ' ValueError: mutable default <class 'fairseq.dataclass.configs.CommonConfig'> for field common is not allowed: use default_factory

supervict0r avatar Jul 13 '23 19:07 supervict0r

I tried this.

Before common: CommonConfig= CommonConfig()

After common: CommonConfig = field(default_factory= CommonConfig())

In the same way, you will have to do it for all the fields required. After that, I got another error. So I uninstalled the fairseq. this absurdism is making me more of a stoic daily.

HardikJain02 avatar Jul 19 '23 17:07 HardikJain02

The official fix of fairseq is too slow. I have created a fixed version of fairseq that works properly on Python 3.11. You can try this If you need.

pip install git+https://github.com/One-sixth/fairseq.git

One-sixth avatar Aug 11 '23 21:08 One-sixth

I am having the same issue.

CrabbyDisk avatar Aug 21 '23 11:08 CrabbyDisk

@CrabbyDisk @theoparis Hey guys, I got same problem and I fixed this by install python 3.10.11

During requirement installation, I found some package can only run under <python 3.11

https://www.python.org/ftp/python/3.10.11/python-3.10.11-amd64.exe

Hope this can help you, enjoy!

Yamamotooo1994 avatar Jan 13 '24 08:01 Yamamotooo1994

Here is the solution for those using Python3.11 https://github.com/facebookresearch/fairseq/issues/5012#issuecomment-1884159687

GUUser91 avatar Mar 19 '24 16:03 GUUser91

This issue was closed because it has been inactive for 15 days since being marked as stale.

github-actions[bot] avatar May 05 '24 04:05 github-actions[bot]