chriamue commited on
Commit
34bca69
1 Parent(s): a280e5d

updates model trained 5 epochs, 0.96 acc

Browse files
Files changed (4) hide show
  1. model.onnx +1 -1
  2. model.safetensors +1 -1
  3. train.py +5 -6
  4. training_args.bin +1 -1
model.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b6925dcdb6fa5675ca0959c0906a1080e12595b60ddf317430a019d90ccb7b2f
3
  size 33762565
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dbfd1293e47384cc215f3cbf0a611548589b91d5fd5e8838a03fdd485bd7151b
3
  size 33762565
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:0d73c2d5a16bb5db09d4ca7e663c7b95f64fd39b1f9abc1dfa479b49224c598f
3
  size 34099540
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2321555c8dae044f37b02055a11673543a7742910c760396e3813b4eba13e4cf
3
  size 34099540
train.py CHANGED
@@ -5,7 +5,7 @@ from transformers import EfficientNetImageProcessor, EfficientNetForImageClassif
5
  import numpy as np
6
 
7
  print("Cuda availability:", torch.cuda.is_available())
8
- cuda = torch.device('cuda') # Default HIP device
9
  print("cuda: ", torch.cuda.get_device_name(device=cuda))
10
 
11
  dataset = load_dataset("chriamue/bird-species-dataset")
@@ -30,9 +30,9 @@ training_args = TrainingArguments(
30
  evaluation_strategy="epoch",
31
  save_strategy="epoch",
32
  learning_rate=5e-5,
33
- per_device_train_batch_size=32,
34
  per_device_eval_batch_size=16,
35
- num_train_epochs=1,
36
  weight_decay=0.01,
37
  load_best_model_at_end=True,
38
  metric_for_best_model="accuracy"
@@ -53,10 +53,9 @@ def transforms(examples):
53
  examples["pixel_values"] = pixel_values
54
  return examples
55
 
56
-
57
  image = dataset["train"][0]["image"]
58
 
59
- dataset["train"] = dataset["train"].shuffle(seed=42).select(range(1500))
60
  # dataset["validation"] = dataset["validation"].select(range(100))
61
  # dataset["test"] = dataset["test"].select(range(100))
62
 
@@ -70,7 +69,7 @@ trainer = Trainer(
70
  compute_metrics=compute_metrics,
71
  )
72
 
73
- train_results = trainer.train(resume_from_checkpoint=True)
74
 
75
  print(trainer.evaluate())
76
 
 
5
  import numpy as np
6
 
7
  print("Cuda availability:", torch.cuda.is_available())
8
+ cuda = torch.device('cuda')
9
  print("cuda: ", torch.cuda.get_device_name(device=cuda))
10
 
11
  dataset = load_dataset("chriamue/bird-species-dataset")
 
30
  evaluation_strategy="epoch",
31
  save_strategy="epoch",
32
  learning_rate=5e-5,
33
+ per_device_train_batch_size=16,
34
  per_device_eval_batch_size=16,
35
+ num_train_epochs=6,
36
  weight_decay=0.01,
37
  load_best_model_at_end=True,
38
  metric_for_best_model="accuracy"
 
53
  examples["pixel_values"] = pixel_values
54
  return examples
55
 
 
56
  image = dataset["train"][0]["image"]
57
 
58
+ # dataset["train"] = dataset["train"].shuffle(seed=42).select(range(1500))
59
  # dataset["validation"] = dataset["validation"].select(range(100))
60
  # dataset["test"] = dataset["test"].select(range(100))
61
 
 
69
  compute_metrics=compute_metrics,
70
  )
71
 
72
+ train_results = trainer.train(resume_from_checkpoint=False)
73
 
74
  print(trainer.evaluate())
75
 
training_args.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:7f697faabe02b3dfda191891c2ce595227bbbb0dc9ee0afe79186ef653788d1c
3
  size 4600
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:817083c686e9f03595b3ef0af83f3f8fdd1a6b49d286980b33af2e23a0e330d8
3
  size 4600