added two modfels
This commit is contained in:
9
Tune.py
9
Tune.py
@@ -10,7 +10,7 @@ from architectures.Model import Model, Architecture
|
||||
# numbre of classes
|
||||
CLASS_SIZE = 20
|
||||
# batch
|
||||
BATCH_SIZE = 8
|
||||
BATCH_SIZE = 16
|
||||
|
||||
# size of images per class trainset + testset
|
||||
# 30 works best, more than that and we dont have enough data
|
||||
@@ -33,7 +33,8 @@ RESOLUTION = 224
|
||||
# - RESNET50
|
||||
# - DENSENET121
|
||||
# - INCEPTION
|
||||
arch = Architecture.RESNET18
|
||||
# - GOOGLENET
|
||||
arch = Architecture.EFFICIENTNET
|
||||
|
||||
# DATA PREPARATION
|
||||
# load data set and prepare
|
||||
@@ -94,7 +95,7 @@ model.train(
|
||||
# save.
|
||||
torch.save(
|
||||
model.get().state_dict(),
|
||||
f'{arch.name}.pth')
|
||||
f'{arch.name.lower()}.pth')
|
||||
|
||||
# done tuning
|
||||
print('Model saved!')
|
||||
@@ -118,4 +119,4 @@ print(f"Total test images for these {CLASS_SIZE} classes: {len(test_data)}")
|
||||
|
||||
# Evaluate
|
||||
model.evaluate(
|
||||
loader = test_loader)
|
||||
loader = test_loader)
|
||||
|
||||
Reference in New Issue
Block a user