AttributeError: module ‘onnxruntime‘ has no attribute ‘InferenceSession‘
·
起因: 测试yolov5在本地电脑上的速度,输入640*640的图像,推理时间需要100ms左右,不正常
切换到conda环境下,发现安装了onnxruntime 以及onnxruntime-gpu
self.net = ort.InferenceSession(model_pb_path, providers=['CUDAExecutionProvider'])
首先是直接
pip uninstall onnxruntime
提示:AttributeError: module ‘onnxruntime’ has no attribute ‘InferenceSession’
需要把onnxruntime-gpu卸载掉
最后重新安装
pip install onnxruntime-gpu
运行发现时间只有30ms
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐


所有评论(0)