162457e4 by 周伟奇

update model

1 parent a379fac9
......@@ -107,7 +107,7 @@ class F3Classification(BaseModel):
image = applications.mobilenet_v2.preprocess_input(image)
return image, label
def load_dataset(self, dataset_dir, name, batch_size=128, augmentation_methods=[]):
def load_dataset(self, dataset_dir, name, batch_size=128, augmentation_methods=[], drop_remainder=True):
image_and_label_list = self.get_image_label_list(dataset_dir)
tensor_slice_dataset = tf.data.Dataset.from_tensor_slices(image_and_label_list, name=name)
dataset = tensor_slice_dataset.shuffle(len(image_and_label_list[0]), reshuffle_each_iteration=True)
......@@ -122,7 +122,7 @@ class F3Classification(BaseModel):
self.preprocess_input, num_parallel_calls=tf.data.AUTOTUNE, deterministic=False)
parallel_batch_dataset = dataset.batch(
batch_size=batch_size,
drop_remainder=True,
drop_remainder=drop_remainder,
num_parallel_calls=tf.data.AUTOTUNE,
deterministic=False,
name=name,
......@@ -144,7 +144,8 @@ class F3Classification(BaseModel):
)
x = base_model.output
x = layers.Dropout(0.5)(x)
x = layers.Dense(256, activation='sigmoid', name='dense')(x)
# x = layers.Dense(256, activation='sigmoid', name='dense')(x)
x = layers.Dense(256, activation='relu', name='dense')(x)
x = layers.Dropout(0.5)(x)
x = layers.Dense(self.class_count, activation='sigmoid', name='output')(x)
self.model = models.Model(inputs=base_model.input, outputs=x)
......@@ -243,7 +244,8 @@ class F3Classification(BaseModel):
batch_size=batch_size,
augmentation_methods=[
'rgb_2_bgr'
]
],
drop_remainder=False,
)
label_true_list = []
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!