From ac1750b442e4c76ea6c9390f6913ce6da644d52c Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Sun, 6 Mar 2022 19:08:22 +0200 Subject: [PATCH] Restructure FastAI examples --- .../fastai-v1/fastai_example/requirements.txt | 2 -- .../fastai-v2/fastai_example/requirements.txt | 2 -- .../fastai_example.py | 0 .../fastai/fastai_with_tensorboard.py | 25 ------------------- .../fastai_with_tensorboard_example.py | 0 .../legacy}/fastai_example.py | 0 .../fastai_with_tensorboard_example.py | 0 .../legacy}/requirements.txt | 0 .../requirements.txt | 0 9 files changed, 29 deletions(-) delete mode 100644 examples/frameworks/fastai-v1/fastai_example/requirements.txt delete mode 100644 examples/frameworks/fastai-v2/fastai_example/requirements.txt rename examples/frameworks/{fastai-v2/fastai_example => fastai}/fastai_example.py (100%) delete mode 100644 examples/frameworks/fastai/fastai_with_tensorboard.py rename examples/frameworks/{fastai-v2/fastai_with_tensorboard_example => fastai}/fastai_with_tensorboard_example.py (100%) rename examples/frameworks/{fastai-v1/fastai_example => fastai/legacy}/fastai_example.py (100%) rename examples/frameworks/{fastai-v1/fastai_with_tensorboard_example => fastai/legacy}/fastai_with_tensorboard_example.py (100%) rename examples/frameworks/{fastai-v1/fastai_with_tensorboard_example => fastai/legacy}/requirements.txt (100%) rename examples/frameworks/{fastai-v2/fastai_with_tensorboard_example => fastai}/requirements.txt (100%) diff --git a/examples/frameworks/fastai-v1/fastai_example/requirements.txt b/examples/frameworks/fastai-v1/fastai_example/requirements.txt deleted file mode 100644 index 8fb1f338..00000000 --- a/examples/frameworks/fastai-v1/fastai_example/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -fastai < 2.0.0 -clearml diff --git a/examples/frameworks/fastai-v2/fastai_example/requirements.txt b/examples/frameworks/fastai-v2/fastai_example/requirements.txt deleted file mode 100644 index 1e155fea..00000000 --- a/examples/frameworks/fastai-v2/fastai_example/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -fastai >= 2.0.0 -clearml diff --git a/examples/frameworks/fastai-v2/fastai_example/fastai_example.py b/examples/frameworks/fastai/fastai_example.py similarity index 100% rename from examples/frameworks/fastai-v2/fastai_example/fastai_example.py rename to examples/frameworks/fastai/fastai_example.py diff --git a/examples/frameworks/fastai/fastai_with_tensorboard.py b/examples/frameworks/fastai/fastai_with_tensorboard.py deleted file mode 100644 index c3cd52a3..00000000 --- a/examples/frameworks/fastai/fastai_with_tensorboard.py +++ /dev/null @@ -1,25 +0,0 @@ -# ClearML - Fastai with Tensorboard example code, automatic logging the model and Tensorboard outputs -# - -from fastai.callbacks.tensorboard import LearnerTensorboardWriter -from fastai.vision import * # Quick access to computer vision functionality - -from clearml import Task - -# Connecting ClearML with the current process, -# from here on everything is logged automatically -task = Task.init(project_name="examples", task_name="Fastai with TensorBoard callback") - -path = untar_data(URLs.MNIST_SAMPLE) - -data = ImageDataBunch.from_folder(path, ds_tfms=(rand_pad(2, 28), []), bs=64) -data.normalize(imagenet_stats) - -learn = cnn_learner(data, models.resnet18, metrics=accuracy) -tboard_path = Path("data/tensorboard/project1") -learn.callback_fns.append( - partial(LearnerTensorboardWriter, base_dir=tboard_path, name="run0") -) - -accuracy(*learn.get_preds()) -learn.fit_one_cycle(6, 0.01) diff --git a/examples/frameworks/fastai-v2/fastai_with_tensorboard_example/fastai_with_tensorboard_example.py b/examples/frameworks/fastai/fastai_with_tensorboard_example.py similarity index 100% rename from examples/frameworks/fastai-v2/fastai_with_tensorboard_example/fastai_with_tensorboard_example.py rename to examples/frameworks/fastai/fastai_with_tensorboard_example.py diff --git a/examples/frameworks/fastai-v1/fastai_example/fastai_example.py b/examples/frameworks/fastai/legacy/fastai_example.py similarity index 100% rename from examples/frameworks/fastai-v1/fastai_example/fastai_example.py rename to examples/frameworks/fastai/legacy/fastai_example.py diff --git a/examples/frameworks/fastai-v1/fastai_with_tensorboard_example/fastai_with_tensorboard_example.py b/examples/frameworks/fastai/legacy/fastai_with_tensorboard_example.py similarity index 100% rename from examples/frameworks/fastai-v1/fastai_with_tensorboard_example/fastai_with_tensorboard_example.py rename to examples/frameworks/fastai/legacy/fastai_with_tensorboard_example.py diff --git a/examples/frameworks/fastai-v1/fastai_with_tensorboard_example/requirements.txt b/examples/frameworks/fastai/legacy/requirements.txt similarity index 100% rename from examples/frameworks/fastai-v1/fastai_with_tensorboard_example/requirements.txt rename to examples/frameworks/fastai/legacy/requirements.txt diff --git a/examples/frameworks/fastai-v2/fastai_with_tensorboard_example/requirements.txt b/examples/frameworks/fastai/requirements.txt similarity index 100% rename from examples/frameworks/fastai-v2/fastai_with_tensorboard_example/requirements.txt rename to examples/frameworks/fastai/requirements.txt