Skip to content

Conversation

Zeyi-Lin
Copy link
Member

@Zeyi-Lin Zeyi-Lin commented May 20, 2024

Description

环境安装:

pip install fastai

测试代码:

import swanlab
from fastai.vision.all import *
from swanlab.integration.fastai import SwanLabCallback

# 加载数据
path = untar_data(URLs.PETS)
dls = ImageDataLoaders.from_name_re(
    path, get_image_files(path / "images"), pat=r"([^/]+)_\d+.jpg$", item_tfms=Resize(224)
)

# 定义模型
learn = vision_learner(dls, resnet34, metrics=error_rate)

# 添加SwanLabCallback
learn.fit_one_cycle(
    5,
    cbs=SwanLabCallback(
        project="fastai-swanlab-integration-test",
        experiment_name="super-test",
        description="Test fastai integration with swanlab",
        config={"test": 1},
        logdir="./logs",
    ),
)

Closes: #555

@Zeyi-Lin Zeyi-Lin requested a review from SAKURA-CAT May 20, 2024 09:46
@Zeyi-Lin Zeyi-Lin self-assigned this May 20, 2024
@Zeyi-Lin Zeyi-Lin added the 💪 enhancement New feature or request label May 20, 2024
@Zeyi-Lin Zeyi-Lin modified the milestones: v0.3.2, v0.3.3 May 20, 2024
@SAKURA-CAT SAKURA-CAT merged commit 76f85bd into main May 20, 2024
@SAKURA-CAT SAKURA-CAT deleted the feat/integration-fastai branch May 20, 2024 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💪 enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REQUEST] 集成fastai

2 participants