Exemplo n.º 1
0
def main():
  """Runs all unit tests with select TF 2.0 features enabled.

  This function should only be used if TensorFlow code is being tested.
  Eventually, all TF 2.0 features will be enabled.
  """
  tf2.enable()  # Switches TensorArrayV2 and control flow V2
  tf.enable_v2_tensorshape()
  tf.enable_resource_variables()  # Required since we use defuns.
  tf.test.main()
Exemplo n.º 2
0
from absl import app, flags
import tensorflow as tf
if tf.version.VERSION.startswith('1.'):
    tf.enable_eager_execution()
if tf.version.VERSION.startswith('1.'):
    tf.enable_v2_behavior()
if tf.version.VERSION.startswith('1.'):
    tf.enable_v2_tensorshape()
from yolo3.enum import BACKBONE, MODE, OPT
from train import train
from train_backbone import train as train_backbone
from yolo import YOLO, detect_video, detect_img, export_tflite_model, export_serving_model, calculate_map, export_tfjs_model

FLAGS = flags.FLAGS

flags.DEFINE_enum_class(
    'backbone',
    default=BACKBONE.MOBILENETV2,
    enum_class=BACKBONE,
    help=
    "Select network backbone, One of {'MOBILENETV2','DARKNET53','EFFICIENTNET'}"
)
flags.DEFINE_integer('batch_size',
                     default=8,
                     lower_bound=0,
                     help="Train batch size")
flags.DEFINE_string('config', default=None, help="Config path")
flags.DEFINE_multi_integer('epochs',
                           default=[10, 10],
                           lower_bound=0,
                           help="Frozen train epochs and Full train epochs")