aigc-apps / sd-webui-EasyPhoto

📷 EasyPhoto | Your Smart AI Photo Generator.
Apache License 2.0
4.97k stars 396 forks source link

[cudnn版本太低与pytorch不兼容 pytorch2.0.1需要cudnn8.5] 报错RuntimeError: FIND was unable to find an engine to execute this computation #27

Closed kuso2006 closed 1 year ago

kuso2006 commented 1 year ago

OS: Ubuntu 20.04 python: 3.10 pytorch:2.0.1 cuda: 11.7 cudnn: 8.2.4 GPU: Nvidia-v100

Encountered an error during training:

Traceback (most recent call last):                                                                                                                            [0/1142]
  File "/home/username/miniconda3/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    [self.run](https://github.com/aigc-apps/sd-webui-EasyPhoto/issues/self.run)()                           
  File "/home/username/miniconda3/lib/python3.10/threading.py", line 953, in run  
    self._target(*self._args, **self._kwargs)                   
  File "/home/username/src/AIGC-Pic/stable-diffusion-webui/extensions/EasyPhoto-sd-webui/scripts/preprocess.py", line 125, in preprocess_images
    sub_image = Image.fromarray(cv2.cvtColor(portrait_enhancement(sub_image)[OutputKeys.OUTPUT_IMG], cv2.COLOR_BGR2RGB))
  File "/home/username/src/AIGC-Pic/stable-diffusion-webui/venv/lib/python3.10/site-packages/modelscope/pipelines/base.py", line 219, in __call__
    output = self._process_single(input, *args, **kwargs)
  File "/home/username/src/AIGC-Pic/stable-diffusion-webui/venv/lib/python3.10/site-packages/modelscope/pipelines/base.py", line 247, in _process_single
    out = self.preprocess(input, **preprocess_params)                              
  File "/home/username/src/AIGC-Pic/stable-diffusion-webui/venv/lib/python3.10/site-packages/modelscope/pipelines/cv/image_portrait_enhancement_[pipeline.py](https://github.com/aigc-apps/sd-webui-EasyPhoto/issues/pipeline.py)", line 17
8, in preprocess                         
    img_sr = [self.sr](https://github.com/aigc-apps/sd-webui-EasyPhoto/issues/self.sr)_process(img)                                                  
  File "/home/username/src/AIGC-Pic/stable-diffusion-webui/venv/lib/python3.10/site-packages/modelscope/pipelines/cv/image_portrait_enhancement_[pipeline.py](https://github.com/aigc-apps/sd-webui-EasyPhoto/issues/pipeline.py)", line 16
1, in sr_process                         
    output = [self.sr](https://github.com/aigc-apps/sd-webui-EasyPhoto/issues/self.sr)_model(img)                                                    
  File "/home/username/src/AIGC-Pic/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/username/src/AIGC-Pic/stable-diffusion-webui/venv/lib/python3.10/site-packages/modelscope/models/cv/super_resolution/rrdbnet_[arch.py](https://github.com/aigc-apps/sd-webui-EasyPhoto/issues/arch.py)", line 123, in for
ward                                                                               
    body_feat = self.conv_body(self.body(feat))
  File "/home/username/src/AIGC-Pic/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)                                           
  File "/home/username/src/AIGC-Pic/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/container.py", line 217, in forward
    input = module(input)               
  File "/home/username/src/AIGC-Pic/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)                                           
  File "/home/username/src/AIGC-Pic/stable-diffusion-webui/venv/lib/python3.10/site-packages/modelscope/models/cv/super_resolution/rrdbnet_[arch.py](https://github.com/aigc-apps/sd-webui-EasyPhoto/issues/arch.py)", line 63, in forw
ard                                                                                
    out = self.rdb1(x)                                                             
  File "/home/username/src/AIGC-Pic/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/username/src/AIGC-Pic/stable-diffusion-webui/venv/lib/python3.10/site-packages/modelscope/models/cv/super_resolution/rrdbnet_[arch.py](https://github.com/aigc-apps/sd-webui-EasyPhoto/issues/arch.py)", line 40, in forw
ard                                                                                
    x4 = self.lrelu(self.conv4([torch.cat](https://github.com/aigc-apps/sd-webui-EasyPhoto/issues/torch.cat)((x, x1, x2, x3), 1)))
  File "/home/username/src/AIGC-Pic/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)                                           
  File "/home/username/src/AIGC-Pic/stable-diffusion-webui/extensions-builtin/Lora/lora.py", line 415, in lora_Conv2d_forward
    return torch.nn.Conv2d_forward_before_lora(self, input)                        
  File "/home/username/src/AIGC-Pic/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 463, in forward
    return self._conv_forward(input, self.weight, self.bias)
  File "/home/username/src/AIGC-Pic/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 459, in _conv_forward
    return F.conv2d(input, weight, bias, self.stride,                              
RuntimeError: FIND was unable to find an engine to execute this computation
wuziheng commented 1 year ago

@bubbliiiing @kuso2006
就log 分析,代码预处理调用 modelscope image_portrait_enhancement ,显示engine not support,我们会持续跟踪这个问题,并在今晚的PR中添加一个容错,如果这个模型执行失败我们会跳过并在log中显示,这个只会影响训练出来的Lora的美观度。

kuso2006 commented 1 year ago

找到问题了,cudnn版本太低与pytorch不兼容,将cudnn升级到8.5.0+即可

bubbliiiing commented 1 year ago

找到问题了,cudnn版本太低与pytorch不兼容,将cudnn升级到8.5.0+即可

感谢,我看了一下似乎就是无法执行conv操作,感觉确实应该是环境问题,谢谢你的反馈。