Browse Source

Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleX into develop

LaraStuStu 5 years ago
parent
commit
99a8a04eca
2 changed files with 2 additions and 2 deletions
  1. 1 1
      deploy/cpp/src/paddlex.cpp
  2. 1 1
      paddlex/deploy.py

+ 1 - 1
deploy/cpp/src/paddlex.cpp

@@ -66,7 +66,7 @@ void Model::create_predictor(const std::string& model_dir,
   if (key == "") {
     config.SetModel(model_file, params_file);
   }
-  if (use_mkl) {
+  if (use_mkl && !use_gpu) {
     if (name != "HRNet" && name != "DeepLabv3p" && name != "PPYOLO") {
         config.EnableMKLDNN();
         config.SetCpuMathLibraryNumThreads(mkl_thread_num);

+ 1 - 1
paddlex/deploy.py

@@ -108,7 +108,7 @@ class Predictor:
             config.enable_use_gpu(100, gpu_id)
         else:
             config.disable_gpu()
-        if use_mkl:
+        if use_mkl and not use_gpu:
             if self.model_name not in ["HRNet", "DeepLabv3p", "PPYOLO"]:
                 config.enable_mkldnn()
                 config.set_cpu_math_library_num_threads(mkl_thread_num)