1、如果按照这种方法创建Ort::Session对象,将会爆出错误
Ort::Session session_(env, modelPath.c_str(), session_options);
先执行到1,然后跳到2,最后爆出3的错误。
2、如果改成这样的代码
try {
Ort::Session session(env, modelPath.c_str(), session_options);
std::cout << "Session created successfully." << std::endl;
} catch (const Ort::Exception &e) {
std::cerr << "Failed to create session: " << e.what()
<< " (Error Code: " << e.GetOrtErrorCode() << ")" << std::endl;
}
错误就消失了
暂时解答:
先记录一下
20241203
-------------------------------------------------------------------------