-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Description
bug描述 Describe the Bug
ocr和clip冲突,全部使用cuda环境时在一段代码内实例化clip模型和ocr模型会稳定出现:OSError: [WinError 127] 找不到指定的程序。cublas64_12.dll" or one of its dependencies.
import clip
from PIL import Image
from paddleocr import PaddleOCR
import torch
from transformers import pipeline
初始化模型
device = "cuda" if torch.cuda.is_available() else "cpu" # 自动选择设备
定义模型路径
OCR_det_path = "./models/PaddleOCR/PP-OCRv5_server_det"
OCR_rec_path = "./models/PaddleOCR/PP-OCRv5_server_rec"
CLIP_model_path = "./models/CLIP/model"
tokenizer_path = "./models/qwen/tokenizer"
embedding_path = "./models/qwen/embedding"
实例化ocr模型
ocr = PaddleOCR(
use_doc_orientation_classify=False,
use_doc_unwarping=False,
use_textline_orientation=False,
text_detection_model_dir=OCR_det_path,
text_recognition_model_dir=OCR_rec_path,
)
实例化clip模型
model, preprocess = clip.load(
"ViT-L/14@336px", device=device, download_root=CLIP_model_path
)
其他补充信息 Additional Supplementary Information
No response