Skip to content

Commit

Permalink
Update sd-scripts, improve requirements outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaltais committed Oct 27, 2024
1 parent 06c3d65 commit 7928f45
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion sd-scripts
36 changes: 26 additions & 10 deletions setup/setup_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,35 @@ def install_requirements_inbulk(

log.info(f"Installing/Validating requirements from {requirements_file}...")

optional_parm += " -U" if upgrade else ""
optional_parm += " --quiet" if not show_stdout else ""
# Build the command as a list
cmd = ["pip", "install", "-r", requirements_file]
if upgrade:
cmd.append("--upgrade")
if not show_stdout:
cmd.append("--quiet")
if optional_parm:
cmd.extend(optional_parm.split())

cmd = f"pip install -r {requirements_file} {optional_parm}"
try:
# Run the command and filter output in real-time
process = subprocess.Popen(
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True
)

if sys.platform.startswith("win32"):
cmd += " | findstr /V \"Requirement already satisfied\""
else:
cmd += " | grep -v \"Requirement already satisfied\""
for line in process.stdout:
if "Requirement already satisfied" not in line:
log.info(line.strip()) if show_stdout else None

# Capture and log any errors
_, stderr = process.communicate()
if process.returncode != 0:
log.error(f"Failed to install requirements: {stderr.strip()}")

run_cmd(cmd)

log.info(f"Requirements from {requirements_file} installed/validated.")
except subprocess.CalledProcessError as e:
log.error(f"An error occurred while installing requirements: {e}")


def configure_accelerate(run_accelerate=False):
Expand Down

1 comment on commit 7928f45

@AbstractEyes
Copy link

@AbstractEyes AbstractEyes commented on 7928f45 Oct 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting an error from runpod setup.
~

root@c4031a911812:/workspace/kohya_ss# ls
 Dockerfile   'config example.toml'   examples       localizations            requirements_linux_docker.txt      requirements_runpod.txt    setup.bat   venv-r
 LICENSE.md    config_files           gui.bat        logs                     requirements_linux_ipex.txt        requirements_windows.txt   setup.ps1
 README.md     dataset                gui.ps1        models                   requirements_linux_rocm.txt        sd-scripts                 setup.sh
 SECURITY.md   deprecated             gui.sh         presets                  requirements_macos_amd64.txt       setup                      test
 _typos.toml   docker-compose.yaml    kohya_gui      requirements.txt         requirements_macos_arm64.txt       setup-3.10.bat             tools
 assets        docs                   kohya_gui.py   requirements_linux.txt   requirements_pytorch_windows.txt   setup-runpod.sh            venv
root@c4031a911812:/workspace/kohya_ss# ./setup-runpod.sh
Installing tk and python3.10-venv...
Hit:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:2 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:4 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64  InRelease
Hit:5 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
111 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-tk is already the newest version (3.10.8-1~22.04).
python3.10-venv is already the newest version (3.10.12-1~22.04.6).
0 upgraded, 0 newly installed, 0 to remove and 111 not upgraded.
Installing required libcudnn release 8.7.0.84-1...
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libcudnn8 is already the newest version (8.7.0.84-1+cuda11.8).
libcudnn8-dev is already the newest version (8.7.0.84-1+cuda11.8).
0 upgraded, 0 newly installed, 0 to remove and 109 not upgraded.
Activating venv...
Running setup_linux.py...
[10/27/24 14:17:59] INFO     Python version is 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0]                                                                           setup_common.py:28
                    INFO     Submodule initialized and updated.                                                                                                             setup_common.py:53
                    INFO     Installing python dependencies. This could take a few minutes as it downloads files.                                                            setup_linux.py:14
                    INFO     If this operation ever runs too long, you can rerun this script in verbose mode to check.                                                       setup_linux.py:15
                    INFO     Kohya_ss GUI version: v24.2.0                                                                                                                 setup_common.py:371

                    INFO     Installing/Validating requirements from requirements_runpod.txt...                                                                            setup_common.py:161
[10/27/24 14:18:01] ERROR    Failed to install requirements: ERROR: Invalid requirement: 'tensorboard==2.14.1 tensorflow==2.14.0 wheel' (from line 7 of                    setup_common.py:188
                             requirements_runpod.txt)
WARNING: No matching packages
Files removed: 0
Configuring accelerate...
Installation completed... You can start the gui with ./gui.sh --share --headless
Deactivating venv...
root@c4031a911812:/workspace/kohya_ss#

I had tensorboard and tensorflow on separate lines at first, then i joined the lines like the original, but it seems to not matter currently. I'll need to use an earlier version.

Please sign in to comment.