diff --git a/mindspore/_version_check.py b/mindspore/_version_check.py index 6fa691bdb1..3780f32c59 100644 --- a/mindspore/_version_check.py +++ b/mindspore/_version_check.py @@ -82,13 +82,13 @@ class GPUEnvChecker(EnvChecker): f"No such directory: {self.cuda_bin}, please check if cuda is installed correctly.") def check_version(self): - v = self._read_version(self.cuda_version) if not Path(self.cuda_version).is_file(): logger.warning("Using custom cuda path, cuda version checking is skiped, please make sure " - "Ascend 910 AI software package version is supported, you can reference to the installation " - "guidelines https://www.mindspore.cn/install") + "cuda version is supported, you can reference to the installation guidelines " + "https://www.mindspore.cn/install") return + v = self._read_version(self.cuda_version) v = version.parse(v) v_str = str(v.major) + "." + str(v.minor) if v_str not in self.version: diff --git a/mindspore/context.py b/mindspore/context.py index 0d97bcb0ed..22cee570e6 100644 --- a/mindspore/context.py +++ b/mindspore/context.py @@ -562,7 +562,7 @@ def set_context(**kwargs): # set device target first if 'device_target' in kwargs: ctx.set_device_target(kwargs['device_target']) - device = kwargs['device_target'] + device = ctx.get_param(ms_ctx_param.device_target) if not device.lower() in __device_target__: raise ValueError(f"Error, package type {__package_name__} support device type {__device_target__}, " f"but got device target {device}")