-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
Describe the bug
got exception after main() return.
Urgency
System information
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows10
- ONNX Runtime installed from (source or binary): binary
- ONNX Runtime version: 1.1.2
- Python version: not used
- Visual Studio version (if applicable): VS2019(cmake project)
- GCC/Compiler version (if compiling from source):
- CUDA/cuDNN version: CUDA10.0, cuDNN7.6.5.32
- GPU model and memory: MX150, 2GMem
To Reproduce
compile and run in X64_Debug mode.
Expected behavior
normally return .no exception.
Additional context
#include <iostream>
#include "onnxruntime_cxx_api.h"
#ifdef GPU_CUDA
#include "cuda_provider_factory.h"
#endif
void test()
{
static Ort::Env env_(ORT_LOGGING_LEVEL_ERROR, "ocrgt");
Ort::SessionOptions session_options;
session_options.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_ALL);
session_options.SetExecutionMode(ExecutionMode::ORT_SEQUENTIAL); //ORT_PARALLEL ORT_SEQUENTIAL
auto status = OrtSessionOptionsAppendExecutionProvider_CUDA(session_options, 0);
std::wstring wpath = L"c:\\work\\ocr-gt\\resnet50v2.onnx";
Ort::Session session(env_, wpath.c_str(), session_options);
size_t in_count = session.GetInputCount();
size_t out_count = session.GetOutputCount();
std::cout << "ok tolaoad model"<< in_count<<","<<out_count<<std::endl;
}
int main(int argc, char* argv[]) {
std::cout << "Hello "<<argv[0]<<std::endl;
test();
std::cout << "ok:结束" << std::endl;
return 0;
}
Metadata
Metadata
Assignees
Labels
No labels