def get_version_and_flavor(executable):
 version_string = get_version_from_pycaffe()
 if (version_string is None):
  version_string = get_version_from_cmdline(executable)
 if (version_string is None):
  version_string = get_version_from_soname(executable)
 if (version_string is None):
  raise ValueError(('Could not find version information for Caffe build ' + ('at "%s". Upgrade your installation' % executable)))
 version = parse_version(version_string)
 if (parse_version(0, 99, 0) > version > parse_version(0, 9, 0)):
  flavor = 'NVIDIA'
  minimum_version = '0.11.0'
  if (version < parse_version(minimum_version)):
   raise ValueError(('Required version "%s" is greater than "%s". Upgrade your installation.' % (minimum_version, version_string)))
 else:
  flavor = 'BVLC'
 return (version_string, flavor)

def get_version_and_flavor ( executable ) : version_string = get_version_from_pycaffe ( ) if ( version_string is None ) : version_string = get_version_from_cmdline ( executable ) if ( version_string is None ) : version_string = get_version_from_soname ( executable ) if ( version_string is None ) : raise ValueError ( ( 'Could not find version information for Caffe build ' + ( 'at "%s". Upgrade your installation' % executable ) ) ) version = parse_version ( version_string ) if ( parse_version ( 0 , 99 , 0 ) > version > parse_version ( 0 , 9 , 0 ) ) : flavor = 'NVIDIA' minimum_version = '0.11.0' if ( version < parse_version ( minimum_version ) ) : raise ValueError ( ( 'Required version "%s" is greater than "%s". Upgrade your installation.' % ( minimum_version , version_string ) ) ) else : flavor = 'BVLC' return ( version_string , flavor )
returns should be called after import_pycaffe() .