Class TensorFlowImportValidator


  • public class TensorFlowImportValidator
    extends Object
    • Constructor Detail

      • TensorFlowImportValidator

        public TensorFlowImportValidator()
    • Method Detail

      • checkAllModelsForImport

        public static TFImportStatus checkAllModelsForImport​(@NonNull
                                                             @NonNull File directory)
                                                      throws IOException
        Recursively scan the specified directory for .pb files, and evaluate which operations/graphs can/can't be imported
        Parameters:
        directory - Directory to scan
        Returns:
        Status for TensorFlow import for all models in
        Throws:
        IOException
      • isArchiveFile

        public static boolean isArchiveFile​(File f)
      • checkModelForImport

        public static TFImportStatus checkModelForImport​(@NonNull
                                                         @NonNull File file,
                                                         boolean exceptionOnRead)
                                                  throws IOException
        Check whether the TensorFlow frozen model (protobuf format) can be imported into SameDiff or not
        Parameters:
        file - Protobuf file
        exceptionOnRead - If true, and the file can't be read, throw an exception. If false, return an "empty" TFImportStatus
        Returns:
        Status for importing the file
        Throws:
        IOException - If error