mirror of
https://github.com/clearml/clearml
synced 2025-02-12 07:35:08 +00:00
Restructure FastAI examples
This commit is contained in:
parent
4c145fbefd
commit
ac1750b442
@ -1,2 +0,0 @@
|
|||||||
fastai < 2.0.0
|
|
||||||
clearml
|
|
@ -1,2 +0,0 @@
|
|||||||
fastai >= 2.0.0
|
|
||||||
clearml
|
|
@ -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)
|
|
Loading…
Reference in New Issue
Block a user