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

ValueError: mutable default <class 'hydra.conf.JobConf.JobConfig.OverrideDirname'> for field override_dirname is not allowed: use default_factory #154

Open
sbmatch opened this issue May 12, 2024 · 5 comments

Comments

@sbmatch
Copy link

sbmatch commented May 12, 2024

执行 python app.py 报错如下内容 python版本3.12

(base) PS D:\sbmatch\Downloads\Compressed\Inpaint-Anything\app> python app.py
Traceback (most recent call last):
  File "D:\sbmatch\Downloads\Compressed\Inpaint-Anything\app\app.py", line 15, in <module>
    from lama_inpaint import inpaint_img_with_lama, build_lama_model, inpaint_img_with_builded_lama
  File "D:\sbmatch\Downloads\Compressed\Inpaint-Anything\lama_inpaint.py", line 19, in <module>
    from saicinpainting.evaluation.utils import move_to_device
  File "D:\sbmatch\Downloads\Compressed\Inpaint-Anything\lama\saicinpainting\evaluation\__init__.py", line 6, in <module>
    from saicinpainting.evaluation.losses.base_loss import SSIMScore, LPIPSScore, FIDScore
  File "D:\sbmatch\Downloads\Compressed\Inpaint-Anything\lama\saicinpainting\evaluation\losses\base_loss.py", line 15, in <module>
    from .lpips import PerceptualLoss
  File "D:\sbmatch\Downloads\Compressed\Inpaint-Anything\lama\saicinpainting\evaluation\losses\lpips.py", line 15, in <module>
    from saicinpainting.utils import get_shape
  File "D:\sbmatch\Downloads\Compressed\Inpaint-Anything\lama\saicinpainting\utils.py", line 12, in <module>
    from pytorch_lightning import seed_everything
  File "D:\Programs\miniconda3\Lib\site-packages\pytorch_lightning\__init__.py", line 28, in <module>
    from pytorch_lightning import metrics  # noqa: E402
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Programs\miniconda3\Lib\site-packages\pytorch_lightning\metrics\__init__.py", line 14, in <module>
    from pytorch_lightning.metrics.classification import (  # noqa: F401
  File "D:\Programs\miniconda3\Lib\site-packages\pytorch_lightning\metrics\classification\__init__.py", line 14, in <module>
    from pytorch_lightning.metrics.classification.accuracy import Accuracy  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Programs\miniconda3\Lib\site-packages\pytorch_lightning\metrics\classification\accuracy.py", line 18, in <module>
    from pytorch_lightning.metrics.functional.accuracy import _accuracy_compute, _accuracy_update
  File "D:\Programs\miniconda3\Lib\site-packages\pytorch_lightning\metrics\functional\__init__.py", line 14, in <module>
    from pytorch_lightning.metrics.functional.accuracy import accuracy  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Programs\miniconda3\Lib\site-packages\pytorch_lightning\metrics\functional\accuracy.py", line 18, in <module>
    from pytorch_lightning.metrics.classification.helpers import _input_format_classification, DataType
  File "D:\Programs\miniconda3\Lib\site-packages\pytorch_lightning\metrics\classification\helpers.py", line 19, in <module>
    from pytorch_lightning.metrics.utils import select_topk, to_onehot
  File "D:\Programs\miniconda3\Lib\site-packages\pytorch_lightning\metrics\utils.py", line 18, in <module>
    from pytorch_lightning.utilities import rank_zero_warn
  File "D:\Programs\miniconda3\Lib\site-packages\pytorch_lightning\utilities\__init__.py", line 18, in <module>
    from pytorch_lightning.utilities.apply_func import move_data_to_device  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Programs\miniconda3\Lib\site-packages\pytorch_lightning\utilities\apply_func.py", line 25, in <module>
    from pytorch_lightning.utilities.imports import _compare_version, _TORCHTEXT_AVAILABLE
  File "D:\Programs\miniconda3\Lib\site-packages\pytorch_lightning\utilities\imports.py", line 76, in <module>
    _HYDRA_EXPERIMENTAL_AVAILABLE = _module_available("hydra.experimental")
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Programs\miniconda3\Lib\site-packages\pytorch_lightning\utilities\imports.py", line 35, in _module_available
    return find_spec(module_path) is not None
           ^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib.util>", line 91, in find_spec
  File "D:\Programs\miniconda3\Lib\site-packages\hydra\__init__.py", line 5, in <module>
    from hydra import utils
  File "D:\Programs\miniconda3\Lib\site-packages\hydra\utils.py", line 8, in <module>
    import hydra._internal.instantiate._instantiate2
  File "D:\Programs\miniconda3\Lib\site-packages\hydra\_internal\instantiate\_instantiate2.py", line 11, in <module>
    from hydra._internal.utils import _locate
  File "D:\Programs\miniconda3\Lib\site-packages\hydra\_internal\utils.py", line 17, in <module>
    from hydra.core.utils import get_valid_filename, validate_config_path
  File "D:\Programs\miniconda3\Lib\site-packages\hydra\core\utils.py", line 19, in <module>
    from hydra.core.hydra_config import HydraConfig
  File "D:\Programs\miniconda3\Lib\site-packages\hydra\core\hydra_config.py", line 6, in <module>
    from hydra.conf import HydraConf
  File "D:\Programs\miniconda3\Lib\site-packages\hydra\conf\__init__.py", line 45, in <module>
    class JobConf:
  File "D:\Programs\miniconda3\Lib\site-packages\hydra\conf\__init__.py", line 70, in JobConf
    @dataclass
     ^^^^^^^^^
  File "D:\Programs\miniconda3\Lib\dataclasses.py", line 1266, in dataclass
    return wrap(cls)
           ^^^^^^^^^
  File "D:\Programs\miniconda3\Lib\dataclasses.py", line 1256, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Programs\miniconda3\Lib\dataclasses.py", line 994, in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Programs\miniconda3\Lib\dataclasses.py", line 852, in _get_field
    raise ValueError(f'mutable default {type(f.default)} for field '
ValueError: mutable default <class 'hydra.conf.JobConf.JobConfig.OverrideDirname'> for field override_dirname is not allowed: use default_factory
@MineBoss506
Copy link

I have the same issue trying to use RVC :(

@shojint
Copy link

shojint commented Jul 10, 2024

Try using python 3.8 instead
#125

@thekaranacharya
Copy link

thekaranacharya commented Sep 4, 2024

Just tested this on Python v3.10.14. It works fine! I think this is the latest python version with which Inpaint-Anything can work.

@MyTimeBox
Copy link

pip uninstall pytorch_lightning
pip install pytorch_lightning

@Tigerdwgth
Copy link

python 3.12 reinstall lighting works

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

6 participants