Skip to content

onnx模型不支持gpu吗 #362

Description

@zqf03118

L20的机器,
pip install cnocr[ort-gpu]后,使用默认模型
运行速度很慢,一张图片需要17s,
改成context='cpu'后运行速度3.6s

看了文档说使用pytorh类型,根据文档下载了pytorch的模型,发现都加载不起来,报错
rec_model_path = './data/densenet_lite_136-gru-pytorch/cnocr-v2.3-densenet_lite_136-gru-epoch=004-ft-model.ckpt'
det_model_path = './data/db_shufflenet_v2/cnstd-v1.2-db_shufflenet_v2-pan-epoch=041-iou_epoch=0.7238-model.ckpt'
ocr = CnOcr(rec_model_fp=rec_model_path, det_model_fp=det_model_path, context='cuda:0',
rec_model_backend='pytorch', det_model_backend='pytorch')

报错
onnxruntime.capi.onnxruntime_pybind11_state.InvalidProtobuf: [ONNXRuntimeError] : 7 : INVALID_PROTOBUF : Load model from data\db_shufflenet_v2\cnstd-v1.2-db_shufflenet_v2-pan-epoch=041-iou_epoch=0.7238-model.ckpt failed:Protobuf parsing failed.

看起来是onnxruntime的问题,但是不是使用的pytoch吗,应该不涉及onnxrumtime吧

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions