YaoFANGUK / video-subtitle-generator

视频音频生成字幕,生成srt文件。无需申请第三方API,本地实现音频转文本。基于Transformer的视频字幕生成框架。A GUI tool for generating subtitle from videos and generating srt files.
Apache License 2.0
857 stars 164 forks source link

CUDA error: no kernel image #25

Open Yead opened 1 year ago

Yead commented 1 year ago

image

I built the environment according to doc, and after run python backend/main.py got this error

Traceback (most recent call last):
  File "backend/main.py", line 275, in <module>
    sg.run()                                                                                                                                                                                                                                                  
  File "backend/main.py", line 214, in run                                                                                                                                                                                                                      
    recognizer = AudioRecogniser(language=self.language)                                                                                                                                                                                                      
  File "backend/main.py", line 32, in __init__                                                                                                                                                                                                                  
    self.model = whisper.load_model(self.model_path)                                                                                                                                                                                                          
  File "/home/ddl/video_cut/video-subtitle-generator/backend/whisper/__init__.py", line 149, in load_model                                                                                                                                                      
    model.load_state_dict(checkpoint["model_state_dict"])                                                                                                                                                                                                     
  File "/home/ddl/anaconda3/envs/vsgEnv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1497, in load_state_dict                                                                                                                                  
    raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(                                                                                                                                                                               
RuntimeError: Error(s) in loading state_dict for Whisper:                                                                                                                                                                                                           
While copying the parameter named "encoder.blocks.0.attn.query.weight", whose dimensions in the model are torch.Size([1024, 1024]) and whose dimensions in the checkpoint are torch.Size([1024, 1024]), an exception occurred : ('CUDA error: no kernel image is available for execution on the device',). 
While copying the parameter named "encoder.blocks.0.attn.key.weight", whose dimensions in the model are torch.Size([1024, 1024]) and whose dimensions in the checkpoint are torch.Size([1024, 1024]), an exception occurred : ('CUDA error: no kernel image is available for execution on the device',).
While copying the parameter named "encoder.blocks.0.attn.value.weight", whose dimensions in the model are torch.Size([1024, 1024]) and whose dimensions in the checkpoint are torch.Size([1024, 1024]), an exception occurred : ('CUDA error: no kernel image is available for execution on the device',). 
While copying the parameter named "encoder.blocks.0.attn.out.weight", whose dimensions in the model are torch.Size([1024, 1024]) and whose dimensions in the checkpoint are torch.Size([1024, 1024]), an exception occurred : ('CUDA error: no kernel image is available for execution on the device',). 

My GPU is 3090, what should I do about it? Looking forward to your reply!

TengliEd commented 6 months ago

I had the same problem