third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py
def _assert_validate(self):
    """Validates the metadata and associated files to be populated.

    Raises:
      ValueError:
        File is recorded in the metadata, but is not going to be populated.
        File has already been packed.
    """
    # Gets files that are recorded in metadata.
    recorded_files = self.get_recorded_associated_file_list()

    # Gets files that have been packed to self._model_file.
    packed_files = self.get_packed_associated_file_list()

    # Gets the file name of those associated files to be populated.
    to_be_populated_files = []
    for af in self._associated_files:
      to_be_populated_files.append(os.path.basename(af))

    # Checks all files recorded in the metadata will be populated.
    for rf in recorded_files:
      if rf not in to_be_populated_files and rf not in packed_files:
        raise ValueError("File, '{0}', is recorded in the metadata, but has "
                         "not been loaded into the populator.".format(rf))

    for f in to_be_populated_files:
      if f in packed_files:
        raise ValueError("File, '{0}', has already been packed.".format(f))

      if f not in recorded_files:
        warnings.warn(
            "File, '{0}', does not exsit in the metadata. But packing it to "
            "tflite model is still allowed.".format(f))
Validates the metadata and associated files to be populated.

    Raises:
      ValueError:
        File is recorded in the metadata, but is not going to be populated.
        File has already been packed.
    
Validates the metadata and associated files to be populated.
Validates the metadata and associated files to be populated .
def _assert_validate(self):
    recorded_files = self.get_recorded_associated_file_list()
    packed_files = self.get_packed_associated_file_list()
    to_be_populated_files = []
    for af in self._associated_files:
      to_be_populated_files.append(os.path.basename(af))
    for rf in recorded_files:
      if rf not in to_be_populated_files and rf not in packed_files:
        raise ValueError("File, '{0}', is recorded in the metadata, but has "
                         "not been loaded into the populator.".format(rf))
    for f in to_be_populated_files:
      if f in packed_files:
        raise ValueError("File, '{0}', has already been packed.".format(f))
      if f not in recorded_files:
        warnings.warn(
            "File, '{0}', does not exsit in the metadata. But packing it to "
            "tflite model is still allowed.".format(f))
def _assert_validate ( self ) : recorded_files = self . get_recorded_associated_file_list ( ) packed_files = self . get_packed_associated_file_list ( ) to_be_populated_files = [ ] for af in self . _associated_files : to_be_populated_files . append ( os . path . basename ( af ) ) for rf in recorded_files : if rf not in to_be_populated_files and rf not in packed_files : raise ValueError ( "File, '{0}', is recorded in the metadata, but has " "not been loaded into the populator." . format ( rf ) ) for f in to_be_populated_files : if f in packed_files : raise ValueError ( "File, '{0}', has already been packed." . format ( f ) ) if f not in recorded_files : warnings . warn ( "File, '{0}', does not exsit in the metadata. But packing it to " "tflite model is still allowed." . format ( f ) )
Validates the metadata and associated files to be populated.
Validates the metadata and associated files to be populated .
"""Validates the metadata and associated files to be populated.

    Raises:
      ValueError:
        File is recorded in the metadata, but is not going to be populated.
        File has already been packed.
    """ # Gets files that are recorded in metadata. # Gets files that have been packed to self._model_file. # Gets the file name of those associated files to be populated. # Checks all files recorded in the metadata will be populated.
File is recorded in the metadata, but is not going to be populated.
File has already been packed.
File is recorded in the metadata but is not going to be populated . File has already been packed .
ValueError
self