コード例 #1
0
 def build_network():
     if model == 'resnet':
         network = resnet_v1(resnet_depth=model_depth,
                             num_classes=n_classes,
                             data_format=data_format)
         return network(inputs=features,
                        is_training=(mode == tf.estimator.ModeKeys.TRAIN))
     elif model == 'densenet':
         if model_depth == 121:
             return densenet_imagenet_121(
                 features,
                 is_training=(mode == tf.estimator.ModeKeys.TRAIN),
                 num_classes=n_classes)
         elif model_depth == 169:
             return densenet_imagenet_169(
                 features,
                 is_training=(mode == tf.estimator.ModeKeys.TRAIN),
                 num_classes=n_classes)
         elif model_depth == 201:
             return densenet_imagenet_201(
                 features,
                 is_training=(mode == tf.estimator.ModeKeys.TRAIN),
                 num_classes=n_classes)
         else:
             raise Exception(f'Unkown densenet model depth: {model_depth}')
     else:
         raise Exception(f'Unknown model: {model}')
コード例 #2
0
 def build_network():
     network = resnet_v1(
         resnet_depth=resnet_depth,
         num_classes=n_classes,
         data_format=data_format)
     return network(
         inputs=features, is_training=(mode == tf.estimator.ModeKeys.TRAIN))
コード例 #3
0
ファイル: main.py プロジェクト: meitetsu3/RecursionTeamCell
 def build_network():
     network = resnet_v1(resnet_depth=resnet_depth,
                         num_classes=n_classes,
                         data_format=data_format)
     return network(inputs=image,
                    cell=one_hot_cell,
                    well_type=one_hot_well,
                    is_training=(mode == tf.estimator.ModeKeys.TRAIN))