提交 3b1b4afe authored 作者: notoraptor's avatar notoraptor

Ensure the warning about missing G++ is not showed on Windows

if the user does explicitely set the cxx config flag in THEANO_FLAGS.
上级 0f446def
...@@ -492,12 +492,15 @@ else: ...@@ -492,12 +492,15 @@ else:
# If the user provided an empty value for cxx, do not warn. # If the user provided an empty value for cxx, do not warn.
theano.configparser.fetch_val_for_key('cxx') theano.configparser.fetch_val_for_key('cxx')
except KeyError: except KeyError:
_logger.warning( # This warning is strangely showed on Windows even if cxx is set to an empty value in THEANO_FLAGS.
'g++ not detected ! Theano will be unable to execute ' # I add this test to ensure we do not warn if it's the user who provided a value for cxx on Windows.
'optimized C-implementations (for both CPU and GPU) and will ' if sys.platform != 'win32' or 'THEANO_FLAGS' not in os.environ or 'cxx=' not in os.environ['THEANO_FLAGS']:
'default to Python implementations. Performance will be severely ' _logger.warning(
'degraded. To remove this warning, set Theano flags cxx to an ' 'g++ not detected ! Theano will be unable to execute '
'empty string.') 'optimized C-implementations (for both CPU and GPU) and will '
'default to Python implementations. Performance will be severely '
'degraded. To remove this warning, set Theano flags cxx to an '
'empty string.')
# Keep the default value the same as the one for the mode FAST_RUN # Keep the default value the same as the one for the mode FAST_RUN
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论