kohya-ss / kohya-ss/sd-scripts

Python 3.11

Open
#887 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
7.2k
Forks
1.2k
Avg merge
11m
Merged PRs (30d)
2

Description

Please make it compatible with Python 3.11

```
13:56:35-478694 INFO Configuring accelerate...
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "G:\_AI\Stable Diffusion\_Training\kohya_ss\venv\Scripts\accelerate.exe\__main__.py", line 4, in
File "G:\_AI\Stable Diffusion\_Training\kohya_ss\venv\Lib\site-packages\accelerate\commands\accelerate_cli.py", line 21, in
from accelerate.commands.estimate import estimate_command_parser
File "G:\_AI\Stable Diffusion\_Training\kohya_ss\venv\Lib\site-packages\accelerate\commands\estimate.py", line 35, in
import timm
File "G:\_AI\Stable Diffusion\_Training\kohya_ss\venv\Lib\site-packages\timm\__init__.py", line 2, in
from .models import create_model, list_models, is_model, list_modules, model_entrypoint, \
File "G:\_AI\Stable Diffusion\_Training\kohya_ss\venv\Lib\site-packages\timm\models\__init__.py", line 28, in
from .maxxvit import *
File "G:\_AI\Stable Diffusion\_Training\kohya_ss\venv\Lib\site-packages\timm\models\maxxvit.py", line 225, in
@dataclass
^^^^^^^^^
File "C:\Users\xyz\AppData\Local\Programs\Python\Python311\Lib\dataclasses.py", line 1230, in dataclass
return wrap(cls)
^^^^^^^^^
File "C:\Users\xyz\AppData\Local\Programs\Python\Python311\Lib\dataclasses.py", line 1220, in wrap
return _process_class(cls, init, repr, eq, order, unsafe_hash,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\xyz\AppData\Local\Programs\Python\Python311\Lib\dataclasses.py", line 958, in _process_class
cls_fields.append(_get_field(cls, name, type, kw_only))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\xyz\AppData\Local\Programs\Python\Python311\Lib\dataclasses.py", line 815, in _get_field
raise ValueError(f'mutable default {type(f.default)} for field '
ValueError: mutable default for field conv_cfg is not allowed: use default_factory
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the Python 3.11 failure from the traceback, which enters accelerate and then timm.models.maxxvit.py at the dataclass definition. Inspect the dependency compatibility involved and verify that configuring accelerate completes without the reported ValueError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.