Skip to content

Found a fix for Winerror 127 #48

@muttondagger

Description

@muttondagger

I have had the great fortune of meeting someone who was able to get the standalone version of Layer Divider to work. However, the automatic1111 extension version of Layer Divider still does not work, according to him, he believes that Layer Divider should be updated for the current gradio version.

Keep in mind that this fix only works for the standalone webui version of Layer Divider, and not the automatic1111 extension version.

Apparently, there is another requirement other than Python 3.10.8 and Git, it is listed on this page: https://zenn.dev/mattyamonaca/articles/b3fec7a6edd722

The hidden prerequisite requirements:

  1. Onnx runtime, CUDA and cuDNN, your CUDA and cuDNN must match up with your Onnx runtime version, and the table can be found here: https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements
  2. Installing Microsoft C++ BuildTools, you must download visual studio build tools with "Desktop development with C++" ticked:
    image
    image
  3. Copy your cublas64_11.dll from your NVIDIA GPU Computing Toolkit which you gotten from downloading CUDA in step 1 into your layer divider folder, here is an example of where to copy and paste it to: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin\cublas64_11.dll to layerdivider\venv\lib\site-packages\torch\lib\cublas64_11.dll

FYI: I was using ONNX runtime 1.15, CUDA 11.8, cuDNN 8.5.0.96, Microsoft Visual Build Tools 2022

My issue was that I kept getting Winerror 127:
image

In order to fix this issue, fulfill the prerequisite requirements, and then follow these steps:

  1. delete the venv folder which is found inside your layer divider folder
  2. open your command prompt or powershell inside your layer divider folder
  3. python -m venv venv
  4. venv\scripts\activate
  5. pip install -r requirements.txt
  6. pip install opencv-python pycocotools matplotlib onnxruntime onnx
  7. pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 --extra-index-url https://download.pytorch.org/whl/cu118
  8. pip install cython packbits onnx onnxruntime-gpu opencv-python numpy Pillow scikit-learn psd-tools requests
  9. pip uninstall gradio
  10. pip install gradio==3.39.0
  11. pip uninstall pytoshop
  12. pip install pytoshop --no-cache-dir
  13. close your command prompt or powershell
  14. open .\venv\Lib\site-packages\pytoshop\codecs.py file in txt editor
  15. add the following:

import pyximport
pyximport.install()

before the line

try:
from . import packbits # type: ignore
except ImportError:
pass

It should look like this:
image

  1. Now you can launch your run_gui.ps1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions