[go: nahoru, domu]

Skip to content

Commit

Permalink
Model Maker: Set DEFAULT_EXPORT_FORMAT and ALLOWED_EXPORT_FORMAT for …
Browse files Browse the repository at this point in the history
…base class.

PiperOrigin-RevId: 339408350
  • Loading branch information
wangtz authored and Copybara-Service committed Oct 28, 2020
1 parent e17ed53 commit ae10e14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,18 @@
import numpy as np
import tensorflow.compat.v2 as tf
from tensorflow_examples.lite.model_maker.core.data_util import data_util
from tensorflow_examples.lite.model_maker.core.export_format import ExportFormat
from tensorflow_examples.lite.model_maker.core.task import custom_model
from tensorflow_examples.lite.model_maker.core.task import model_util


class ClassificationModel(custom_model.CustomModel):
""""The abstract base class that represents a Tensorflow classification model."""

DEFAULT_EXPORT_FORMAT = (ExportFormat.TFLITE, ExportFormat.LABEL)
ALLOWED_EXPORT_FORMAT = (ExportFormat.TFLITE, ExportFormat.LABEL,
ExportFormat.SAVED_MODEL)

def __init__(self, model_spec, index_to_label, num_classes, shuffle,
train_whole_model):
"""Initialize a instance with data, deploy mode and other related parameters.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
class CustomModel(abc.ABC):
""""The abstract base class that represents a Tensorflow classification model."""

DEFAULT_EXPORT_FORMAT = ()
ALLOWED_EXPORT_FORMAT = ()
DEFAULT_EXPORT_FORMAT = (ExportFormat.TFLITE)
ALLOWED_EXPORT_FORMAT = (ExportFormat.TFLITE, ExportFormat.SAVED_MODEL)

def __init__(self, model_spec, shuffle):
"""Initialize a instance with data, deploy mode and other related parameters.
Expand Down

0 comments on commit ae10e14

Please sign in to comment.