Fix img classification tests (#13456)

*  Update image-classification example's tests

* 🔥 remove cats_and_dogs test samples

* 💄 fix flake8
This commit is contained in:
Nathan Raw 2021-09-07 03:58:45 -06:00 committed by GitHub
parent 92d4ef9ab0
commit 79815090ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 4 additions and 6 deletions

View File

@ -19,7 +19,6 @@ import json
import logging
import os
import sys
from unittest.case import skip
from unittest.mock import patch
import torch
@ -344,7 +343,6 @@ class ExamplesTests(TestCasePlus):
result = get_results(tmp_dir)
self.assertGreaterEqual(result["eval_bleu"], 30)
@skip("The test is failing as accuracy is 0, re-enable when fixed.")
def test_run_image_classification(self):
stream_handler = logging.StreamHandler(sys.stdout)
logger.addHandler(stream_handler)
@ -354,19 +352,19 @@ class ExamplesTests(TestCasePlus):
run_image_classification.py
--output_dir {tmp_dir}
--model_name_or_path google/vit-base-patch16-224-in21k
--train_dir tests/fixtures/tests_samples/cats_and_dogs/
--dataset_name hf-internal-testing/cats_vs_dogs_sample
--do_train
--do_eval
--learning_rate 2e-5
--learning_rate 1e-4
--per_device_train_batch_size 2
--per_device_eval_batch_size 1
--remove_unused_columns False
--overwrite_output_dir True
--dataloader_num_workers 16
--metric_for_best_model accuracy
--max_steps 30
--max_steps 10
--train_val_split 0.1
--seed 7
--seed 42
""".split()
if is_cuda_and_apex_available():

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB