SavedModel

open class SavedModel : TensorFlowInferenceModel

Inference model built on SavedModelBundle format to predict on images.

Constructors

SavedModel
Link copied to clipboard
fun SavedModel()

Types

Companion
Link copied to clipboard
object Companion

Functions

close
Link copied to clipboard
open override fun close()

Closes internal resources: session and kGraph.

copy
Link copied to clipboard
open override fun copy(copiedModelName: String?, saveOptimizerState: Boolean, copyWeights: Boolean): TensorFlowInferenceModel
graphToString
Link copied to clipboard
fun graphToString(): String

Forms the graph description in string format.

input
Link copied to clipboard
fun input(inputOp: Input)

Chain-like setter to set up inputOp.

output
Link copied to clipboard
fun output(outputOp: Output)

Chain-like setter to set up outputOp.

predict
Link copied to clipboard
open override fun predict(inputData: FloatArray): Int

Generates output prediction for the input sample.

fun predict(inputData: FloatArray, inputTensorName: String, outputTensorName: String): Int

Predicts the class of inputData.

fun predict(dataset: OnHeapDataset, inputTensorName: String, outputTensorName: String): List<Int>

Predicts labels for all observation in dataset.

predictSoftly
Link copied to clipboard
open override fun predictSoftly(inputData: FloatArray, predictionTensorName: String): FloatArray
reshape
Link copied to clipboard
open override fun reshape(vararg dims: Long)
toString
Link copied to clipboard
open override fun toString(): String

Properties

inputDimensions
Link copied to clipboard
open override val inputDimensions: LongArray
isModelInitialized
Link copied to clipboard
var isModelInitialized: Boolean = false

Is true when model is initialized.

kGraph
Link copied to clipboard
lateinit var kGraph: KGraph

TensorFlow wrapped computational graph.

name
Link copied to clipboard
var name: String? = null

Model name.

shape
Link copied to clipboard
lateinit var shape: LongArray

Data shape for prediction.