diff --git a/python/paddle/utils/cpp_extension/extension_utils.py b/python/paddle/utils/cpp_extension/extension_utils.py index 402aaa501b86b3674d1662e7d4d97c26feea3e1b..fff92d85c8f9588efd96182613a50f7c53cff14e 100644 --- a/python/paddle/utils/cpp_extension/extension_utils.py +++ b/python/paddle/utils/cpp_extension/extension_utils.py @@ -982,7 +982,10 @@ def check_abi_compatibility(compiler, verbose=False): compiler_info = subprocess.check_output( compiler, stderr=subprocess.STDOUT) if six.PY3: - compiler_info = compiler_info.decode() + try: + compiler_info = compiler_info.decode('UTF-8') + except UnicodeDecodeError: + compiler_info = compiler_info.decode('gbk') match = re.search(r'(\d+)\.(\d+)\.(\d+)', compiler_info.strip()) if match is not None: version = match.groups()