nateraw commited on
Commit
dcf495d
1 Parent(s): f68c236

commit files to HF hub

Browse files
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ checkpoint-*/
README.md ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - huggingpics
5
+ - image-classification
6
+ - generated_from_trainer
7
+ metrics:
8
+ - accuracy
9
+ model_index:
10
+ - name: planes-trains-automobiles
11
+ results:
12
+ - task:
13
+ name: Image Classification
14
+ type: image-classification
15
+ metric:
16
+ name: Accuracy
17
+ type: accuracy
18
+ value: 0.9850746268656716
19
+ ---
20
+
21
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
22
+ should probably proofread and complete it, then remove this comment. -->
23
+
24
+ # planes-trains-automobiles
25
+
26
+ This model is a fine-tuned version of [google/vit-base-patch16-224-in21k](https://huggingface.co/google/vit-base-patch16-224-in21k) on the huggingpics dataset.
27
+ It achieves the following results on the evaluation set:
28
+ - Loss: 0.0534
29
+ - Accuracy: 0.9851
30
+
31
+
32
+ ## Model description
33
+
34
+ Autogenerated by HuggingPics🤗🖼️
35
+
36
+ Create your own image classifier for **anything** by running [the demo on Google Colab](https://colab.research.google.com/github/nateraw/huggingpics/blob/main/HuggingPics.ipynb).
37
+
38
+ Report any issues with the demo at the [github repo](https://github.com/nateraw/huggingpics).
39
+ ## Example Images
40
+
41
+
42
+ #### automobiles
43
+
44
+ ![automobiles](images/automobiles.jpg)
45
+
46
+ #### planes
47
+
48
+ ![planes](images/planes.jpg)
49
+
50
+ #### trains
51
+
52
+ ![trains](images/trains.jpg)
53
+
54
+
55
+ ## Intended uses & limitations
56
+
57
+ More information needed
58
+
59
+ ## Training and evaluation data
60
+
61
+ More information needed
62
+
63
+ ## Training procedure
64
+
65
+ ### Training hyperparameters
66
+
67
+ The following hyperparameters were used during training:
68
+ - learning_rate: 2e-05
69
+ - train_batch_size: 8
70
+ - eval_batch_size: 8
71
+ - seed: 1337
72
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
73
+ - lr_scheduler_type: linear
74
+ - num_epochs: 4
75
+ - mixed_precision_training: Native AMP
76
+
77
+ ### Training results
78
+
79
+ | Training Loss | Epoch | Step | Validation Loss | Accuracy |
80
+ |:-------------:|:-----:|:----:|:---------------:|:--------:|
81
+ | 0.0283 | 1.0 | 48 | 0.0434 | 0.9851 |
82
+ | 0.0224 | 2.0 | 96 | 0.0548 | 0.9851 |
83
+ | 0.0203 | 3.0 | 144 | 0.0445 | 0.9851 |
84
+ | 0.0195 | 4.0 | 192 | 0.0534 | 0.9851 |
85
+
86
+
87
+ ### Framework versions
88
+
89
+ - Transformers 4.9.2
90
+ - Pytorch 1.9.0+cu102
91
+ - Datasets 1.11.0
92
+ - Tokenizers 0.10.3
all_results.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 4.0,
3
+ "total_flos": 0.0,
4
+ "train_loss": 0.023352553563502926,
5
+ "train_runtime": 233.1724,
6
+ "train_samples_per_second": 6.57,
7
+ "train_steps_per_second": 0.823
8
+ }
config.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "google/vit-base-patch16-224-in21k",
3
+ "architectures": [
4
+ "ViTForImageClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.0,
7
+ "hidden_act": "gelu",
8
+ "hidden_dropout_prob": 0.0,
9
+ "hidden_size": 768,
10
+ "id2label": {
11
+ "0": "automobiles",
12
+ "1": "planes",
13
+ "2": "trains"
14
+ },
15
+ "image_size": 224,
16
+ "initializer_range": 0.02,
17
+ "intermediate_size": 3072,
18
+ "label2id": {
19
+ "automobiles": "0",
20
+ "planes": "1",
21
+ "trains": "2"
22
+ },
23
+ "layer_norm_eps": 1e-12,
24
+ "model_type": "vit",
25
+ "num_attention_heads": 12,
26
+ "num_channels": 3,
27
+ "num_hidden_layers": 12,
28
+ "patch_size": 16,
29
+ "torch_dtype": "float32",
30
+ "transformers_version": "4.9.2"
31
+ }
images/automobiles.jpg ADDED
images/planes.jpg ADDED
images/trains.jpg ADDED
preprocessor_config.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_normalize": true,
3
+ "do_resize": true,
4
+ "feature_extractor_type": "ViTFeatureExtractor",
5
+ "image_mean": [
6
+ 0.5,
7
+ 0.5,
8
+ 0.5
9
+ ],
10
+ "image_std": [
11
+ 0.5,
12
+ 0.5,
13
+ 0.5
14
+ ],
15
+ "resample": 2,
16
+ "size": 224
17
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cbe3c77709d39b188d1840940951756659a5cb58e13b92935d33d69b3a229a49
3
+ size 343282929
runs/Aug23_21-37-56_90489a400d03/1629754680.1882749/events.out.tfevents.1629754680.90489a400d03.658.13 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7fffa4466850b15eb210b2cee8eccea0227990f8fb4491a6619d01a82663d6d7
3
+ size 4323
runs/Aug23_21-37-56_90489a400d03/events.out.tfevents.1629754680.90489a400d03.658.12 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f47398f622806d914d00ced1979145c7167cf3aeeeb76e029ba20da5e04ced71
3
+ size 7707
train_results.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 4.0,
3
+ "total_flos": 0.0,
4
+ "train_loss": 0.023352553563502926,
5
+ "train_runtime": 233.1724,
6
+ "train_samples_per_second": 6.57,
7
+ "train_steps_per_second": 0.823
8
+ }
trainer_state.json ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": 0.9850746268656716,
3
+ "best_model_checkpoint": "./outputs/checkpoint-48",
4
+ "epoch": 4.0,
5
+ "global_step": 192,
6
+ "is_hyper_param_search": false,
7
+ "is_local_process_zero": true,
8
+ "is_world_process_zero": true,
9
+ "log_history": [
10
+ {
11
+ "epoch": 0.21,
12
+ "learning_rate": 1.8958333333333334e-05,
13
+ "loss": 0.0325,
14
+ "step": 10
15
+ },
16
+ {
17
+ "epoch": 0.42,
18
+ "learning_rate": 1.7916666666666667e-05,
19
+ "loss": 0.031,
20
+ "step": 20
21
+ },
22
+ {
23
+ "epoch": 0.62,
24
+ "learning_rate": 1.6875e-05,
25
+ "loss": 0.0295,
26
+ "step": 30
27
+ },
28
+ {
29
+ "epoch": 0.83,
30
+ "learning_rate": 1.5833333333333333e-05,
31
+ "loss": 0.0283,
32
+ "step": 40
33
+ },
34
+ {
35
+ "epoch": 1.0,
36
+ "eval_accuracy": 0.9850746268656716,
37
+ "eval_loss": 0.04340995103120804,
38
+ "eval_runtime": 1.9606,
39
+ "eval_samples_per_second": 34.174,
40
+ "eval_steps_per_second": 4.59,
41
+ "step": 48
42
+ },
43
+ {
44
+ "epoch": 1.04,
45
+ "learning_rate": 1.479166666666667e-05,
46
+ "loss": 0.0268,
47
+ "step": 50
48
+ },
49
+ {
50
+ "epoch": 1.25,
51
+ "learning_rate": 1.375e-05,
52
+ "loss": 0.0249,
53
+ "step": 60
54
+ },
55
+ {
56
+ "epoch": 1.46,
57
+ "learning_rate": 1.2708333333333333e-05,
58
+ "loss": 0.0236,
59
+ "step": 70
60
+ },
61
+ {
62
+ "epoch": 1.67,
63
+ "learning_rate": 1.1666666666666668e-05,
64
+ "loss": 0.023,
65
+ "step": 80
66
+ },
67
+ {
68
+ "epoch": 1.88,
69
+ "learning_rate": 1.0625e-05,
70
+ "loss": 0.0224,
71
+ "step": 90
72
+ },
73
+ {
74
+ "epoch": 2.0,
75
+ "eval_accuracy": 0.9850746268656716,
76
+ "eval_loss": 0.05477194860577583,
77
+ "eval_runtime": 1.9694,
78
+ "eval_samples_per_second": 34.021,
79
+ "eval_steps_per_second": 4.57,
80
+ "step": 96
81
+ },
82
+ {
83
+ "epoch": 2.08,
84
+ "learning_rate": 9.583333333333335e-06,
85
+ "loss": 0.0216,
86
+ "step": 100
87
+ },
88
+ {
89
+ "epoch": 2.29,
90
+ "learning_rate": 8.541666666666666e-06,
91
+ "loss": 0.0213,
92
+ "step": 110
93
+ },
94
+ {
95
+ "epoch": 2.5,
96
+ "learning_rate": 7.500000000000001e-06,
97
+ "loss": 0.0205,
98
+ "step": 120
99
+ },
100
+ {
101
+ "epoch": 2.71,
102
+ "learning_rate": 6.458333333333334e-06,
103
+ "loss": 0.0206,
104
+ "step": 130
105
+ },
106
+ {
107
+ "epoch": 2.92,
108
+ "learning_rate": 5.416666666666667e-06,
109
+ "loss": 0.0203,
110
+ "step": 140
111
+ },
112
+ {
113
+ "epoch": 3.0,
114
+ "eval_accuracy": 0.9850746268656716,
115
+ "eval_loss": 0.04450145736336708,
116
+ "eval_runtime": 1.9416,
117
+ "eval_samples_per_second": 34.507,
118
+ "eval_steps_per_second": 4.635,
119
+ "step": 144
120
+ },
121
+ {
122
+ "epoch": 3.12,
123
+ "learning_rate": 4.3750000000000005e-06,
124
+ "loss": 0.02,
125
+ "step": 150
126
+ },
127
+ {
128
+ "epoch": 3.33,
129
+ "learning_rate": 3.3333333333333333e-06,
130
+ "loss": 0.0196,
131
+ "step": 160
132
+ },
133
+ {
134
+ "epoch": 3.54,
135
+ "learning_rate": 2.2916666666666666e-06,
136
+ "loss": 0.0196,
137
+ "step": 170
138
+ },
139
+ {
140
+ "epoch": 3.75,
141
+ "learning_rate": 1.25e-06,
142
+ "loss": 0.0194,
143
+ "step": 180
144
+ },
145
+ {
146
+ "epoch": 3.96,
147
+ "learning_rate": 2.0833333333333333e-07,
148
+ "loss": 0.0195,
149
+ "step": 190
150
+ },
151
+ {
152
+ "epoch": 4.0,
153
+ "eval_accuracy": 0.9850746268656716,
154
+ "eval_loss": 0.053447265177965164,
155
+ "eval_runtime": 1.9698,
156
+ "eval_samples_per_second": 34.013,
157
+ "eval_steps_per_second": 4.569,
158
+ "step": 192
159
+ },
160
+ {
161
+ "epoch": 4.0,
162
+ "step": 192,
163
+ "total_flos": 0.0,
164
+ "train_loss": 0.023352553563502926,
165
+ "train_runtime": 233.1724,
166
+ "train_samples_per_second": 6.57,
167
+ "train_steps_per_second": 0.823
168
+ }
169
+ ],
170
+ "max_steps": 192,
171
+ "num_train_epochs": 4,
172
+ "total_flos": 0.0,
173
+ "trial_name": null,
174
+ "trial_params": null
175
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f59fb11a6ea363b68fd3296567eb3a86f2116a225e3fdb842fc90800d6332673
3
+ size 2799