def _set_config_dict_value(self, value): if not value: self._config_dict_value = None else: if value == '<PATHS>': executable = self.find_executable('caffe') if not executable: executable = self.find_executable('caffe.exe') else: executable = os.path.join(value, 'build', 'tools', 'caffe') version = self.get_version(executable) if version >= (0,12): multi_gpu = True else: multi_gpu = False # TODO: ask caffe for this information cuda_enabled = len(device_query.get_devices()) > 0 self._config_dict_value = { 'executable': executable, 'version': version, 'multi_gpu': multi_gpu, 'cuda_enabled': cuda_enabled, }
def _set_config_dict_value(self, value): if not value: self._config_dict_value = None else: if value == '<PATHS>': executable = self.find_executable('caffe') if not executable: executable = self.find_executable('caffe.exe') else: executable = os.path.join(value, 'build', 'tools', 'caffe') info_dict = self.get_info(executable) version = parse_version(info_dict['ver_str']) if version >= parse_version(0, 12): multi_gpu = True else: multi_gpu = False flavor = info_dict['flavor'] # TODO: ask caffe for this information cuda_enabled = len(device_query.get_devices()) > 0 self._config_dict_value = { 'executable': executable, 'version': version, 'ver_str': info_dict['ver_str'], 'multi_gpu': multi_gpu, 'cuda_enabled': cuda_enabled, 'flavor': flavor }
def _set_config_dict_value(self, value): if not value: self._config_dict_value = None else: if value == '<PATHS>': executable = self.find_executable('caffe') else: executable = os.path.join(value, 'build', 'tools', 'caffe') version = self.get_version(executable) if version >= (0, 12): multi_gpu = True else: multi_gpu = False # TODO: ask caffe for this information cuda_enabled = len(device_query.get_devices()) > 0 self._config_dict_value = { 'executable': executable, 'version': version, 'multi_gpu': multi_gpu, 'cuda_enabled': cuda_enabled, }
def _set_config_dict_value(self, value): if not value: self._config_dict_value = None else: if value == "<PATHS>": executable = self.find_executable("caffe") if not executable: executable = self.find_executable("caffe.exe") else: executable = os.path.join(value, "build", "tools", "caffe") info_dict = self.get_info(executable) version = parse_version(info_dict["ver_str"]) if version >= parse_version(0, 12): multi_gpu = True else: multi_gpu = False flavor = info_dict["flavor"] # TODO: ask caffe for this information cuda_enabled = len(device_query.get_devices()) > 0 self._config_dict_value = { "executable": executable, "version": version, "ver_str": info_dict["ver_str"], "multi_gpu": multi_gpu, "cuda_enabled": cuda_enabled, "flavor": flavor, }
# Read the symlink for libcaffe from ldd output symlink = caffe_line.split()[2] filename = os.path.basename(os.path.realpath(symlink)) # parse the version string match = re.match(r'%s(.*)\.so\.(\S+)$' % (libname), filename) if match: return match.group(2) else: return None if 'CAFFE_ROOT' in os.environ: executable, version, flavor = load_from_envvar('CAFFE_ROOT') elif 'CAFFE_HOME' in os.environ: executable, version, flavor = load_from_envvar('CAFFE_HOME') else: executable, version, flavor = load_from_path() option_list['caffe'] = { 'executable': executable, 'version': version, 'flavor': flavor, 'multi_gpu': (flavor == 'BVLC' or parse_version(version) >= parse_version(0, 12)), 'cuda_enabled': (len(device_query.get_devices()) > 0), }
% executable) # Read the symlink for libcaffe from ldd output symlink = caffe_line.split()[2] filename = os.path.basename(os.path.realpath(symlink)) # parse the version string match = re.match(r'%s(.*)\.so\.(\S+)$' % (libname), filename) if match: return match.group(2) else: return None if 'CAFFE_ROOT' in os.environ: executable, version, flavor = load_from_envvar('CAFFE_ROOT') elif 'CAFFE_HOME' in os.environ: executable, version, flavor = load_from_envvar('CAFFE_HOME') else: executable, version, flavor = load_from_path() option_list['caffe'] = { 'executable': executable, 'version': version, 'flavor': flavor, 'multi_gpu': (flavor == 'BVLC' or parse_version(version) >= parse_version(0,12)), 'cuda_enabled': (len(device_query.get_devices()) > 0), }