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

[Bug]: Version: v1.6.0 Options TypeError: 'type' object is not subscriptable #12884

Closed
1 task done
trueto opened this issue Aug 31, 2023 · 11 comments
Closed
1 task done
Labels
bug-report Report of a bug, yet to be confirmed

Comments

@trueto
Copy link

trueto commented Aug 31, 2023

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What happened?

Python 3.8.10 (default, Jun 4 2021, 15:09:15)
[GCC 7.5.0]
Version: v1.6.0
Commit hash: 5ef669d
current transparent-background 1.2.4
Installing requirements for TemporalKit extension
Launching Web UI with arguments: --share --api --xformers --no-gradio-queue --no-half-vae
Traceback (most recent call last):
File "launch.py", line 48, in
main()
File "launch.py", line 44, in main
start()
File "/root/autodl-tmp/stable-diffusion-webui/modules/launch_utils.py", line 432, in start
import webui
File "/root/autodl-tmp/stable-diffusion-webui/webui.py", line 13, in
initialize.imports()
File "/root/autodl-tmp/stable-diffusion-webui/modules/initialize.py", line 33, in imports
from modules import shared_init
File "/root/autodl-tmp/stable-diffusion-webui/modules/shared_init.py", line 5, in
from modules import shared
File "/root/autodl-tmp/stable-diffusion-webui/modules/shared.py", line 5, in
from modules import shared_cmd_options, shared_gradio_themes, options, shared_items, sd_models_types
File "/root/autodl-tmp/stable-diffusion-webui/modules/options.py", line 74, in
class Options:
File "/root/autodl-tmp/stable-diffusion-webui/modules/options.py", line 77, in Options
def init(self, data_labels: dict[str, OptionInfo], restricted_opts):
TypeError: 'type' object is not subscriptable

Steps to reproduce the problem

python launch.py

What should have happened?

the webui shoud launch

Sysinfo

Python 3.8.10 (default, Jun 4 2021, 15:09:15)
[GCC 7.5.0]
Version: v1.6.0

What browsers do you use to access the UI ?

No response

Console logs

Python 3.8.10 (default, Jun  4 2021, 15:09:15) 
[GCC 7.5.0]
Version: v1.6.0
Commit hash: 5ef669de080814067961f28357256e8fe27544f4
current transparent-background 1.2.4
Installing requirements for TemporalKit extension
Launching Web UI with arguments: --share --api --xformers --no-gradio-queue --no-half-vae
Traceback (most recent call last):
  File "launch.py", line 48, in <module>
    main()
  File "launch.py", line 44, in main
    start()
  File "/root/autodl-tmp/stable-diffusion-webui/modules/launch_utils.py", line 432, in start
    import webui
  File "/root/autodl-tmp/stable-diffusion-webui/webui.py", line 13, in <module>
    initialize.imports()
  File "/root/autodl-tmp/stable-diffusion-webui/modules/initialize.py", line 33, in imports
    from modules import shared_init
  File "/root/autodl-tmp/stable-diffusion-webui/modules/shared_init.py", line 5, in <module>
    from modules import shared
  File "/root/autodl-tmp/stable-diffusion-webui/modules/shared.py", line 5, in <module>
    from modules import shared_cmd_options, shared_gradio_themes, options, shared_items, sd_models_types
  File "/root/autodl-tmp/stable-diffusion-webui/modules/options.py", line 74, in <module>
    class Options:
  File "/root/autodl-tmp/stable-diffusion-webui/modules/options.py", line 77, in Options
    def __init__(self, data_labels: dict[str, OptionInfo], restricted_opts):
TypeError: 'type' object is not subscriptable

Additional information

help!!!

@trueto trueto added the bug-report Report of a bug, yet to be confirmed label Aug 31, 2023
@catboxanon
Copy link
Collaborator

Please fill out the issue form correctly. You did not provide a sysinfo file.

System info file, generated by WebUI. You can generate it in settings, on the Sysinfo page. Drag the file into the field to upload it. If you submit your report without including the sysinfo file, the report will be closed. If needed, review the report to make sure it includes no personal information you don't want to share. If you can't start WebUI, you can use --dump-sysinfo commandline argument to generate the file.

@trueto
Copy link
Author

trueto commented Aug 31, 2023

Please fill out the issue form correctly. You did not provide a sysinfo file.

System info file, generated by WebUI. You can generate it in settings, on the Sysinfo page. Drag the file into the field to upload it. If you submit your report without including the sysinfo file, the report will be closed. If needed, review the report to make sure it includes no personal information you don't want to share. If you can't start WebUI, you can use --dump-sysinfo commandline argument to generate the file.

--dump-sysinfo also don't work

Traceback (most recent call last):
  File "launch.py", line 48, in <module>
    main()
  File "launch.py", line 29, in main
    filename = launch_utils.dump_sysinfo()
  File "/root/autodl-tmp/stable-diffusion-webui/modules/launch_utils.py", line 440, in dump_sysinfo
    from modules import sysinfo
  File "/root/autodl-tmp/stable-diffusion-webui/modules/sysinfo.py", line 13, in <module>
    from modules import paths_internal, timer, shared, extensions, errors
  File "/root/autodl-tmp/stable-diffusion-webui/modules/shared.py", line 5, in <module>
    from modules import shared_cmd_options, shared_gradio_themes, options, shared_items, sd_models_types
  File "/root/autodl-tmp/stable-diffusion-webui/modules/options.py", line 74, in <module>
    class Options:
  File "/root/autodl-tmp/stable-diffusion-webui/modules/options.py", line 77, in Options
    def __init__(self, data_labels:dict[str,OptionInfo], restricted_opts):
TypeError: 'type' object is not subscriptable

@Z-L-D
Copy link

Z-L-D commented Aug 31, 2023

Were you ever able to open this? Python 3.10 definitely has a lot of changes that might prevent it from running in 3.8.

@catboxanon
Copy link
Collaborator

As Z-L-D mentioned, try upgrading Python to 3.10 -- support below that version is not guaranteed.

@justinclift
Copy link

try upgrading Python to 3.10

Ugh. Ubuntu 20.04 has Python 3.8, so that could be a bit inconvenient for some.

@Z-L-D
Copy link

Z-L-D commented Aug 31, 2023

Well, you can update to the latest Ubuntu 22.04.3 which comes with python 3.10.4, or you can update python directly. Do this only if you know what this means for your system though.

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.10

@justinclift
Copy link

Thanks. Neither is an option here at this stage, but I only really play around with StableDiffusion. Not being able to use v1.6.0 isn't going to be the end of the world (for me). 😄

@trueto
Copy link
Author

trueto commented Sep 1, 2023

Thanks! python==3.10.0 can work

@luh0502
Copy link

luh0502 commented Sep 4, 2023

It's work for me, Are there any other solutions available?

stable-diffusion-webui-lh $ CUDA_VISIBLE_DEVICES=5 /root/paddlejob/workspace/env_run/output/env_webui/bin/python launch.py --server-name 10.67.190.143 --port 8911 --xformers --theme dark --enable-insecure-extension-access
Python 3.7.6 (default, Jan 8 2020, 19:59:22)
[GCC 7.3.0]
Version: v1.6.0
Commit hash: 5ef669d
Launching Web UI with arguments: --server-name 10.67.190.143 --port 8911 --xformers --theme dark --enable-insecure-extension-access
No SDP backend available, likely because you are running in pytorch versions < 2.0. In fact, you are using PyTorch 1.13.1+cu117. You might want to consider upgrading.
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /root/paddlejob/workspace/env_run/output/xs/stable-diffusion-webui-lh/launch.py:48 in │
│ │
│ 45 │
│ 46 │
│ 47 if name == "main": │
│ ❱ 48 │ main() │
│ 49 │
│ │
│ /root/paddlejob/workspace/env_run/output/xs/stable-diffusion-webui-lh/launch.py:44 in main │
│ │
│ 41 │ if args.test_server: │
│ 42 │ │ configure_for_tests() │
│ 43 │ │
│ ❱ 44 │ start() │
│ 45 │
│ 46 │
│ 47 if name == "main": │
│ │
│ /root/paddlejob/workspace/env_run/output/xs/stable-diffusion-webui-lh/modules/launch_utils.py:43 │
│ 7 in start │
│ │
│ 434 │
│ 435 def start(): │
│ 436 │ print(f"Launching {'API server' if '--nowebui' in sys.argv else 'Web UI'} with argum │
│ ❱ 437 │ import webui │
│ 438 │ if '--nowebui' in sys.argv: │
│ 439 │ │ webui.api_only() │
│ 440 │ else: │
│ │
│ /root/paddlejob/workspace/env_run/output/xs/stable-diffusion-webui-lh/webui.py:13 in │
│ │
│ 10 startup_timer = timer.startup_timer │
│ 11 startup_timer.record("launcher") │
│ 12 │
│ ❱ 13 initialize.imports() │
│ 14 │
│ 15 initialize.check_versions() │
│ 16 │
│ │
│ /root/paddlejob/workspace/env_run/output/xs/stable-diffusion-webui-lh/modules/initialize.py:33 │
│ in imports │
│ │
│ 30 │ import sgm.modules.encoders.modules # noqa: F401 │
│ 31 │ startup_timer.record("import sgm") │
│ 32 │ │
│ ❱ 33 │ from modules import shared_init │
│ 34 │ shared_init.initialize() │
│ 35 │ startup_timer.record("initialize shared") │
│ 36 │
│ │
│ /root/paddlejob/workspace/env_run/output/xs/stable-diffusion-webui-lh/modules/shared_init.py:5 │
│ in │
│ │
│ 2 │
│ 3 import torch │
│ 4 │
│ ❱ 5 from modules import shared │
│ 6 from modules.shared import cmd_opts │
│ 7 │
│ 8 │
│ │
│ /root/paddlejob/workspace/env_run/output/xs/stable-diffusion-webui-lh/modules/shared.py:5 in │
│ │
│ │
│ 2 │
│ 3 import gradio as gr │
│ 4 │
│ ❱ 5 from modules import shared_cmd_options, shared_gradio_themes, options, shared_items, sd_ │
│ 6 from modules.paths_internal import models_path, script_path, data_path, sd_configs_path, │
│ 7 from modules import util │
│ 8 │
│ │
│ /root/paddlejob/workspace/env_run/output/xs/stable-diffusion-webui-lh/modules/options.py:74 in │
│ │
│ │
│ 71 options_builtin_fields = {"data_labels", "data", "restricted_opts", "typemap"} │
│ 72 │
│ 73 │
│ ❱ 74 class Options: │
│ 75 │ typemap = {int: float} │
│ 76 │ │
│ 77 │ def init(self, data_labels: dict[str, OptionInfo], restricted_opts): │
│ │
│ /root/paddlejob/workspace/env_run/output/xs/stable-diffusion-webui-lh/modules/options.py:77 in │
│ Options │
│ │
│ 74 class Options: │
│ 75 │ typemap = {int: float} │
│ 76 │ │
│ ❱ 77 │ def init(self, data_labels: dict[str, OptionInfo], restricted_opts): │
│ 78 │ │ self.data_labels = data_labels │
│ 79 │ │ self.data = {k: v.default for k, v in self.data_labels.items()} │
│ 80 │ │ self.restricted_opts = restricted_opts │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: 'type' object is not subscriptable

@dongyun-two
Copy link

Solution:

Create conda environment:
$ conda create -y -n stable-diffusion python=3.10

Edit the following line of webui-user.sh:
python_cmd="/home//anaconda3/envs/stable-diffusion/bin/python3"

Run:
bash webui.sh

@hamidsaifi77
Copy link

I solved it by installing pyenv and then installing the python versin 3.10.0 and then activating that by pyenv global 3.10.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Report of a bug, yet to be confirmed
Projects
None yet
Development

No branches or pull requests

7 participants