Package org.nd4j.imports.tensorflow
Class TensorFlowImportValidator
- java.lang.Object
-
- org.nd4j.imports.tensorflow.TensorFlowImportValidator
-
public class TensorFlowImportValidator extends Object
-
-
Constructor Summary
Constructors Constructor Description TensorFlowImportValidator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TFImportStatuscheckAllModelsForImport(@NonNull File directory)Recursively scan the specified directory for .pb files, and evaluate which operations/graphs can/can't be importedstatic TFImportStatuscheckAllModelsForImport(@NonNull File directory, boolean includeArchives)static TFImportStatuscheckAllModelsForImport(File directory, String[] fileExtensions)static TFImportStatuscheckModelForImport(@NonNull File file)static TFImportStatuscheckModelForImport(@NonNull File file, boolean exceptionOnRead)Check whether the TensorFlow frozen model (protobuf format) can be imported into SameDiff or notstatic TFImportStatuscheckModelForImport(String path, InputStream is, boolean exceptionOnRead)static booleanisArchiveFile(File f)
-
-
-
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
-
checkAllModelsForImport
public static TFImportStatus checkAllModelsForImport(@NonNull @NonNull File directory, boolean includeArchives) throws IOException
- Throws:
IOException
-
checkAllModelsForImport
public static TFImportStatus checkAllModelsForImport(File directory, String[] fileExtensions) throws IOException
- Throws:
IOException
-
isArchiveFile
public static boolean isArchiveFile(File f)
-
checkModelForImport
public static TFImportStatus checkModelForImport(@NonNull @NonNull File file) throws IOException
SeecheckModelForImport(File). Defaults to exceptionOnRead = false- Throws:
IOException
-
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 fileexceptionOnRead- 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
-
checkModelForImport
public static TFImportStatus checkModelForImport(String path, InputStream is, boolean exceptionOnRead) throws IOException
- Throws:
IOException
-
-