diff --git a/reco/detectors/rich/mcbm/CbmRichMCbmDenoiseCnn.cxx b/reco/detectors/rich/mcbm/CbmRichMCbmDenoiseCnn.cxx
index 5ecebd00b7c392764e53dde29903fef5a023c119..96f46b2c1eda5f597785f171bdb4ac21fb36affc 100644
--- a/reco/detectors/rich/mcbm/CbmRichMCbmDenoiseCnn.cxx
+++ b/reco/detectors/rich/mcbm/CbmRichMCbmDenoiseCnn.cxx
@@ -28,13 +28,6 @@ void CbmRichMCbmDenoiseCnn::Init()
   fOrtEnv = std::make_unique<Ort::Env>(ORT_LOGGING_LEVEL_WARNING, GetName());
 
   fOrtSessionOptions = std::make_unique<Ort::SessionOptions>();
-  fOrtSession        = std::make_unique<Ort::Session>(*fOrtEnv, fOnnxFilePath.c_str(), *fOrtSessionOptions);
-
-  fOrtRunOptions    = std::make_unique<Ort::RunOptions>(nullptr);
-  fOrtAllocatorInfo = std::make_unique<Ort::MemoryInfo>(Ort::MemoryInfo::CreateCpu(OrtDeviceAllocator, OrtMemTypeCPU));
-  fOrtInput         = std::make_unique<Ort::Value>(Ort::Value::CreateTensor<float>(
-    *fOrtAllocatorInfo, fInput.data(), fInput.size(), fInputShape.data(), fInputShape.size()));
-
   // Thread numbers need to be explicitly set. With the current Ort version it can't detect
   // the numbers on the cluster, should be fixed in a later version.
   fOrtSessionOptions->SetIntraOpNumThreads(1);
@@ -42,6 +35,13 @@ void CbmRichMCbmDenoiseCnn::Init()
   fOrtSessionOptions->SetExecutionMode(ORT_SEQUENTIAL);
   fOrtSessionOptions->SetGraphOptimizationLevel(ORT_ENABLE_ALL);
 
+  fOrtSession = std::make_unique<Ort::Session>(*fOrtEnv, fOnnxFilePath.c_str(), *fOrtSessionOptions);
+
+  fOrtRunOptions    = std::make_unique<Ort::RunOptions>(nullptr);
+  fOrtAllocatorInfo = std::make_unique<Ort::MemoryInfo>(Ort::MemoryInfo::CreateCpu(OrtDeviceAllocator, OrtMemTypeCPU));
+  fOrtInput         = std::make_unique<Ort::Value>(Ort::Value::CreateTensor<float>(
+    *fOrtAllocatorInfo, fInput.data(), fInput.size(), fInputShape.data(), fInputShape.size()));
+
   fCbmRichDigiMapManager = &CbmRichDigiMapManager::GetInstance();
 }