コード例 #1
0
ファイル: caffe_option.py プロジェクト: andreydung/DIGITS
    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,
                    }
コード例 #2
0
ファイル: caffe_option.py プロジェクト: zhang365947064/DIGITS
    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
            }
コード例 #3
0
    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,
            }
コード例 #4
0
ファイル: caffe_option.py プロジェクト: dongjoon-hyun/DIGITS
    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,
            }
コード例 #5
0
ファイル: caffe.py プロジェクト: vjtagaltera/nvidia-DIGITS
    # 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),
}
コード例 #6
0
ファイル: caffe.py プロジェクト: dgistJihunJung/DIGITS
                         % 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),
}