NVIDIA / Stable-Diffusion-WebUI-TensorRT

TensorRT Extension for Stable Diffusion Web UI
MIT License
1.9k stars 144 forks source link

Error running webui trying to export default engines and webui crashes #92

Open Waethorn opened 11 months ago

Waethorn commented 11 months ago

I tried the instructions to set up a clean install of SD.webUI as provided by the instructions here (I had another install - no, it wasn't running at the same time - in a different folder with a bunch of plugins integrated into it but wanted to test TRT on a clean install):

This is what I get as a result:

Exporting v1-5-pruned-emaonly to TensorRT {'sample': [(1, 4, 64, 64), (2, 4, 64, 64), (8, 4, 96, 96)], 'timesteps': [(1,), (2,), (8,)], 'encoder_hidden_states': [(1, 77, 768), (2, 77, 768), (8, 154, 768)]} No ONNX file found. Exporting ONNX... Disabling attention optimization D:\sd.webui\system\python\lib\site-packages\einops\einops.py:314: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! known = {axis for axis in composite_axis if axis_name2known_length[axis] != _unknown_axis_length} D:\sd.webui\system\python\lib\site-packages\einops\einops.py:315: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! unknown = {axis for axis in composite_axis if axis_name2known_length[axis] == _unknown_axis_length} D:\sd.webui\webui\repositories\stable-diffusion-stability-ai\ldm\modules\diffusionmodules\openaimodel.py:158: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! assert x.shape[1] == self.channels D:\sd.webui\webui\modules\sd_hijack_unet.py:26: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if a.shape[-2:] != b.shape[-2:]: D:\sd.webui\webui\repositories\stable-diffusion-stability-ai\ldm\modules\diffusionmodules\openaimodel.py:109: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! assert x.shape[1] == self.channels Press any key to continue . . .

Not sure how to fix this. I followed the instructions to the letter. When it comes to exporting the engines, it just closes the terminal window after I hit a key. Running this on W11-22H2/RTX3070/Game Ready Driver 545.84 provided by GF Experience.

Johnny-Six commented 11 months ago

This is precisely what I'm getting with my 4070 on a different Model. Don't know solution , but presumably you know that if you want to avoid the error in the meantime you have to remove the TensorRT folder from the Extensions section of A1111. I tried updating my Python from 3.10.6 to 3.10.11 but nothing changed. Just to clarify, I also get an Python error at start-up - which can be skipped over - but then I see the reported error when I try to generate the TensorRT Extension.

rrademacher commented 10 months ago

this is the same problem I have been having since the start.

Waethorn commented 10 months ago

Just tried a new download of SD 1.0-pre into a new folder as per NVIDIA's instructions, updated to 1.6.0-2-something as of this time stamp. Still no change when exporting models - same error. NVIDIA drivers updated to 546.01. How is anybody getting this working?!

Johnny-Six commented 10 months ago

You just ruined all my hopes and dreams for this weekend!

marvelmaster commented 10 months ago

same on model: notRealRealisticXL_v10a

oh just updated my cuda tools to newest version and now it worked