stable-diffusion-webui-tensorrt icon indicating copy to clipboard operation
stable-diffusion-webui-tensorrt copied to clipboard

Error loading script: trt.py

Open sunwukong0727 opened this issue 2 years ago • 13 comments

script_module = script_loading.load_module(scriptfile.path) File "H:\stable-diffusion-webui\modules\script_loading.py", line 10, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "H:\stable-diffusion-webui\extensions\stable-diffusion-webui-tensorrt\scripts\trt.py", line 6, in from modules import script_callbacks, sd_unet, devices, shared, paths_internal ImportError: cannot import name 'sd_unet' from 'modules' (unknown location)

sunwukong0727 avatar May 29 '23 08:05 sunwukong0727

edit: found the problem: apparently need to use "dev" branch

I'm having a similar problem.

I installed 2019 c++ build tools and pycuda & onnx after which they both seem to have installed fine and errors related to those are gone. Now I get this:

Error loading script: trt.py Traceback (most recent call last): File "C:\Auto1111\modules\scripts.py", line 263, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "C:\Auto1111\modules\script_loading.py", line 10, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "C:\Auto1111\extensions\stable-diffusion-webui-tensorrt\scripts\trt.py", line 6, in from modules import script_callbacks, sd_unet, devices, shared, paths_internal ImportError: cannot import name 'sd_unet' from 'modules' (unknown location)

jepjoo avatar May 29 '23 09:05 jepjoo

git checkout dev 感谢jilekjosef

sunwukong0727 avatar May 29 '23 10:05 sunwukong0727

@sunwukong0727 @jepjoo dev branch seems to be invisible for me both in web and in Git bash when I call $ git branch -r --list from the directory of the extension. Is it visible/accessible for everyone else? How does that work?

MxDeWitt avatar May 29 '23 12:05 MxDeWitt

在stable diffution 主目录下 鼠标右键 git checkout dev

On Mon, May 29, 2023 at 5:37 PM jepjoo @.***> wrote:

I'm havin a similar problem.

I installed 2019 c++ build tools and pycuda & onnx after which they both seem to have installed fine and errors related to those are gone. Now I get this:

Error loading script: trt.py Traceback (most recent call last): File "C:\Auto1111\modules\scripts.py", line 263, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "C:\Auto1111\modules\script_loading.py", line 10, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "C:\Auto1111\extensions\stable-diffusion-webui-tensorrt\scripts\trt.py", line 6, in from modules import script_callbacks, sd_unet, devices, shared, paths_internal ImportError: cannot import name 'sd_unet' from 'modules' (unknown location)

— Reply to this email directly, view it on GitHub https://github.com/AUTOMATIC1111/stable-diffusion-webui-tensorrt/issues/16#issuecomment-1566853235, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6ZIEIEY3W7XBWQGVAKOJGTXIRU6PANCNFSM6AAAAAAYSQTUBU . You are receiving this because you authored the thread.Message ID: @.*** .com>

sunwukong0727 avatar May 29 '23 12:05 sunwukong0727

Excuse my noobness but how can I get the "dev" branch? Or what should I do before I type "git checkout dev"?

zaazii avatar May 29 '23 15:05 zaazii

@sunwukong0727 @jepjoo dev branch seems to be invisible for me both in web and in Git bash when I call $ git branch -r --list from the directory of the extension. Is it visible/accessible for everyone else? How does that work?

I think you have to do git checkout dev from the directory of the main repo, not the extension.

TigerFox57 avatar May 29 '23 15:05 TigerFox57

Find a blank space in the main directory of stable diffusion, right-click on git base, and enter git checkout dev

On Mon, May 29, 2023 at 11:07 PM zaazii @.***> wrote:

Excuse my noobness but how can I get the "dev" branch?

— Reply to this email directly, view it on GitHub https://github.com/AUTOMATIC1111/stable-diffusion-webui-tensorrt/issues/16#issuecomment-1567254789, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6ZIEIEHLOZ3HZIY45AAOKLXIS3RVANCNFSM6AAAAAAYSQTUBU . You are receiving this because you were mentioned.Message ID: @.*** .com>

sunwukong0727 avatar May 29 '23 15:05 sunwukong0727

Thank you. It said branch is up to date with origin\dev. But I am still getting the Error loading script: trt.py

zaazii avatar May 29 '23 16:05 zaazii

Thank you. It said branch is up to date with origin\dev. But I am still getting the Error loading script: trt.py

I am also getting the same error despite being on dev.

No module 'xformers'. Proceeding without it. Error loading script: trt.py Traceback (most recent call last): File "E:\StableDiffusion\web-ui\modules\scripts.py", line 256, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "E:\StableDiffusion\web-ui\modules\script_loading.py", line 11, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "E:\StableDiffusion\web-ui\extensions\stable-diffusion-webui-tensorrt\scripts\trt.py", line 6, in from modules import script_callbacks, sd_unet, devices, shared, paths_internal ImportError: cannot import name 'sd_unet' from 'modules' (unknown location)

Proof on dev branch:

PS E:\StableDiffusion\web-ui> git checkout dev Already on 'dev' Your branch is up to date with 'origin/dev'

Xility-Wil avatar May 29 '23 21:05 Xility-Wil

Did you guys fetch the latest changes to dev with git fetch --all (or equivalent)?

papuSpartan avatar May 30 '23 00:05 papuSpartan

Did you guys fetch the latest changes to dev with git fetch --all (or equivalent)?

I can confirm about an hour after I originally posted, I realized I forgot to pull the new branch 🤦‍♂️

Xility-Wil avatar May 30 '23 04:05 Xility-Wil

i did all and still get Error loading script: trt.py

4lt3r3go avatar Jun 02 '23 08:06 4lt3r3go

(base) cybertimon@server:~/Repositories/stable-diffusion-webui/extensions/stable-diffusion-webui-tensorrt$ git checkout dev error: pathspec 'dev' did not match any file(s) known to git

I get this error everytime I try to checkout to dev branch. Any help?

CyberTimon avatar Jun 13 '23 10:06 CyberTimon