ostris / ai-toolkit

Various AI scripts. Mostly Stable Diffusion stuff.
MIT License
220 stars 25 forks source link

A couple of problems I've encountered with the installation on my end #3

Closed woshilhz001 closed 11 months ago

woshilhz001 commented 11 months ago

Problems with windows installation

1.Removed accelerator from requirements.txt.

Collecting accelerator (from -r requirements.txt (line 8))
  Using cached accelerator-2023.7.18.dev1.tar.gz (352 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [2 lines of output]
      Accelerator only works on posix platforms (like Linux).
      You could try running under WSL.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

2.ai-toolkit\toolkit\config.py -72-77 line Adding encoding='utf-8' works fine.

    if real_config_path.endswith('.json') or real_config_path.endswith('.jsonc'):
        with open(real_config_path, 'r',encoding='utf-8') as f:
            config = json.load(f, object_pairs_hook=OrderedDict)
    elif real_config_path.endswith('.yaml') or real_config_path.endswith('.yml'):
        with open(real_config_path, 'r',encoding='utf-8') as f:
            config = yaml.load(f, Loader=fixed_loader)
Traceback (most recent call last):
  File "D:\ai\sd_webui_all\ai-toolkit\run.py", line 73, in <module>
    main()
  File "D:\ai\sd_webui_all\ai-toolkit\run.py", line 69, in main
    raise e
  File "D:\ai\sd_webui_all\ai-toolkit\run.py", line 60, in main
    job = get_job(config_file, args.name)
  File "D:\ai\sd_webui_all\ai-toolkit\toolkit\job.py", line 5, in get_job
    config = get_config(config_path, name)
  File "D:\ai\sd_webui_all\ai-toolkit\toolkit\config.py", line 77, in get_config
    config = yaml.load(f, Loader=fixed_loader)
  File "C:\Users\woshi\miniconda3\envs\ai-tools\lib\site-packages\yaml\__init__.py", line 79, in load
    loader = Loader(stream)
  File "C:\Users\woshi\miniconda3\envs\ai-tools\lib\site-packages\yaml\loader.py", line 34, in __init__
    Reader.__init__(self, stream)
  File "C:\Users\woshi\miniconda3\envs\ai-tools\lib\site-packages\yaml\reader.py", line 85, in __init__
    self.determine_encoding()
  File "C:\Users\woshi\miniconda3\envs\ai-tools\lib\site-packages\yaml\reader.py", line 124, in determine_encoding
    self.update_raw()
  File "C:\Users\woshi\miniconda3\envs\ai-tools\lib\site-packages\yaml\reader.py", line 178, in update_raw
    data = self.stream.read(size)
UnicodeDecodeError: 'gbk' codec can't decode byte 0xaa in position 3245: illegal multibyte sequence
jaretburkett commented 11 months ago

Thanks for the details. I don't run windows so I don't run into these things. Let me know if you find anything else. Fixed with -> https://github.com/ostris/ai-toolkit/commit/b865ac8b24cd2302480a9c98cbc7e0f36b0eb7f8