Commit e9326105 authored by Yuxin Wu's avatar Yuxin Wu

fix build

parent 7ae014f1
import os import os
from .utils import logger
# issue#7378 may happen with custom opencv. It doesn't hurt to disable opencl # issue#7378 may happen with custom opencv. It doesn't hurt to disable opencl
os.environ['OPENCV_OPENCL_RUNTIME'] = '' os.environ['OPENCV_OPENCL_RUNTIME'] = ''
try: try:
# issue#1924 may happen on old systems # issue#1924 may happen on old systems
import cv2 # noqa import cv2 # noqa
except ImportError:
pass
else:
if int(cv2.__version__.split('.')[0]) == 3: if int(cv2.__version__.split('.')[0]) == 3:
cv2.ocl.setUseOpenCL(False) cv2.ocl.setUseOpenCL(False)
# check if cv is built with cuda # check if cv is built with cuda
...@@ -19,9 +15,11 @@ else: ...@@ -19,9 +15,11 @@ else:
answer = line.split()[-1].lower() answer = line.split()[-1].lower()
if answer == 'yes': if answer == 'yes':
# issue#1197 # issue#1197
logger.warn("OpenCV is built with CUDA support. " print("OpenCV is built with CUDA support. "
"This may cause slow initialization or sometimes segfault with TensorFlow.") "This may cause slow initialization or sometimes segfault with TensorFlow.")
break break
except ImportError, TypeError:
pass
os.environ['TF_ENABLE_WINOGRAD_NONFUSED'] = '1' # issue#9339 os.environ['TF_ENABLE_WINOGRAD_NONFUSED'] = '1' # issue#9339
os.environ['TF_AUTOTUNE_THRESHOLD'] = '3' # use more warm-up os.environ['TF_AUTOTUNE_THRESHOLD'] = '3' # use more warm-up
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment