Update inference.cpp [bug in case of cudaEnable = false] (#18831)

Signed-off-by: pmermigkas <62157711+pmermigkas@users.noreply.github.com>
This commit is contained in:
pmermigkas 2025-01-23 14:26:51 +02:00 committed by GitHub
parent 60d6d011fd
commit 729ef7f270
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -107,11 +107,11 @@ char* YOLO_V8::CreateSession(DL_INIT_PARAM& iParams) {
iouThreshold = iParams.iouThreshold;
imgSize = iParams.imgSize;
modelType = iParams.modelType;
cudaEnable = iParams.cudaEnable;
env = Ort::Env(ORT_LOGGING_LEVEL_WARNING, "Yolo");
Ort::SessionOptions sessionOption;
if (iParams.cudaEnable)
{
cudaEnable = iParams.cudaEnable;
OrtCUDAProviderOptions cudaOption;
cudaOption.device_id = 0;
sessionOption.AppendExecutionProvider_CUDA(cudaOption);