[![Overview](https://raw.githubusercontent.com/SwanHubX/swanlab/main/readme_files/swanlab-overview-new.png)](https://swanlab.cn/)
<div align="center">
<a href="https://swanlab.cn">🔥SwanLab 在线版</a> · <a href="https://docs.swanlab.cn">📃 文档</a> · <a href="https://github.com/swanhubx/swanlab/issues">报告问题</a> · <a href="https://geektechstudio.feishu.cn/share/base/form/shrcnyBlK8OMD0eweoFcc2SvWKc">建议反馈</a> · <a href="https://docs.swanlab.cn/zh/guide_cloud/general/changelog.html">更新日志</a>
[![license][license-shield]][license-shield-link]
[![last-commit][last-commit-shield]][last-commit-shield-link]
[![pypi-version][pypi-version-shield]][pypi-version-shield-link]
[![pypi-downloads][pypi-downloads-shield]][pypi-downloads-shield-link]
[![issues][issues-shield]][issues-shield-link]
<br>
[![swanlab-cloud][swanlab-cloud-shield]][swanlab-cloud-shield-link]
[![wechat][wechat-shield]][wechat-shield-link]
[![colab][colab-shield]][colab-shield-link]
中文 / [English](README_EN.md) / [日本語](README_JP.md) / [Русский](README_RU.md)
👋 加入我们的[微信群](https://docs.swanlab.cn/zh/guide_cloud/community/online-support.html)
</div>
> 2024.12.16
> 为了更好地发展SwanLab,我们正在将云端版的域名进行备案迁移。
> 在备案期间swanlab.cn将会访问异常,大概2~10个工作日内会备案迁移完成。
> 在此期间python部分实验跟踪和记录不受影响,网页端访问:https://swanlab.115.zone 即可,感谢大家!
## 目录
- [👋🏻 什么是SwanLab](#-什么是swanlab)
- [📃 在线演示](#-在线演示)
- [🏁 快速开始](#-快速开始)
- [💻 自托管](#-自托管)
- [🚗 框架集成](#-框架集成)
- [🆚 与熟悉的工具的比较](#-与熟悉的工具的比较)
- [👥 社区](#-社区)
- [📃 协议](#-协议)
<br/>
## 👋🏻 什么是SwanLab
SwanLab 是一款开源、轻量的 AI 实验跟踪工具,提供了一个跟踪、比较、和协作实验的平台。
SwanLab 提供了友好的 API 和漂亮的界面,结合了超参数跟踪、指标记录、在线协作、实验链接分享等功能,让您可以快速跟踪 AI 实验、可视化过程、记录超参数,并分享给伙伴。
以下是其核心特性列表:
**1. 📊 实验指标与超参数跟踪**: 极简的代码嵌入您的机器学习 pipeline,跟踪记录训练关键指标
- 自由的超参数与实验配置记录
- 支持的元数据类型:标量指标、图像、音频、文本、...
- 支持的图表类型:折线图、媒体图(图像、音频、文本)、...
- 自动记录:控制台 logging、GPU 硬件、Git 信息、Python 解释器、Python 库列表、代码目录
![](https://raw.githubusercontent.com/SwanHubX/swanlab/main/readme_files/overview-2.png)
**2. ⚡️ 全面的框架集成**: PyTorch、Tensorflow、PyTorch Lightning、🤗HuggingFace、Transformers、MMEngine、Ultralytics、fastai、Tensorboard、OpenAI、ZhipuAI、Hydra、...
**3. 📦 组织实验**: 集中式仪表板,快速管理多个项目与实验,通过整体视图速览训练全局
**4. 🆚 比较结果**: 通过在线表格与对比图表比较不同实验的超参数和结果,挖掘迭代灵感
**5. 👥 在线协作**: 您可以与团队进行协作式训练,支持将实验实时同步在一个项目下,您可以在线查看团队的训练记录,基于结果发表看法与建议
**6. ✉️ 分享结果**: 复制和发送持久的 URL 来共享每个实验,方便地发送给伙伴,或嵌入到在线笔记中
**7. 💻 支持自托管**: 支持不联网使用,自托管的社区版同样可以查看仪表盘与管理实验
> \[!IMPORTANT]
>
> **收藏项目**,你将从 GitHub 上无延迟地接收所有发布通知~ ⭐️
![star-us](https://raw.githubusercontent.com/SwanHubX/swanlab/main/readme_files/star-us.png)
<br>
## 📃 在线演示
来看看 SwanLab 的在线演示:
| [ResNet50 猫狗分类](https://swanlab.cn/@ZeyiLin/Cats_Dogs_Classification/runs/jzo93k112f15pmx14vtxf/chart) | [Yolov8-COCO128 目标检测](https://swanlab.cn/@ZeyiLin/ultratest/runs/yux7vclmsmmsar9ear7u5/chart) |
| :----------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------: |
| <a href="https://swanlab.cn/@ZeyiLin/Cats_Dogs_Classification/runs/jzo93k112f15pmx14vtxf/chart"> <img src="https://raw.githubusercontent.com/SwanHubX/swanlab/main/readme_files/example-mnist.png"> </a> | <a href="https://swanlab.cn/@ZeyiLin/ultratest/runs/yux7vclmsmmsar9ear7u5/chart"> <img src="https://raw.githubusercontent.com/SwanHubX/swanlab/main/readme_files/example-yolo.png"> </a> |
| 跟踪一个简单的 ResNet50 模型在猫狗数据集上训练的图像分类任务。 | 使用 Yolov8 在 COCO128 数据集上进行目标检测任务,跟踪训练超参数和指标。 |
| [Qwen2 指令微调](https://swanlab.cn/@ZeyiLin/Qwen2-fintune/runs/cfg5f8dzkp6vouxzaxlx6/chart) | [LSTM Google 股票预测](https://swanlab.cn/@ZeyiLin/Google-Stock-Prediction/charts) |
| :-----------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------: |
| <a href="https://swanlab.cn/@ZeyiLin/Qwen2-fintune/runs/cfg5f8dzkp6vouxzaxlx6/chart"> <img src="https://raw.githubusercontent.com/SwanHubX/swanlab/main/readme_files/example-qwen2.png"> </a> | <a href="https://swanlab.cn/@ZeyiLin/Google-Stock-Prediction/charts"> <img src="https://raw.githubusercontent.com/SwanHubX/swanlab/main/readme_files/example-lstm.png"> </a> |
| 跟踪 Qwen2 大语言模型的指令微调训练,完成简单的指令遵循。 | 使用简单的 LSTM 模型在 Google 股价数据集上训练,实现对未来股价的预测。 |
[更多案例](https://docs.swanlab.cn/zh/examples/mnist.html)
<br>
## 🏁 快速开始
### 1.安装
```bash
pip install swanlab
```
### 2.登录并获取 API Key
1. 免费[注册账号](https://swanlab.cn)
2. 登录账号,在用户设置 > [API Key](https://swanlab.cn/settings) 里复制您的 API Key
3. 打开终端,输入:
```bash
swanlab login
```
出现提示时,输入您的 API Key,按下回车,完成登陆。
### 3.将 SwanLab 与你的代码集成
```python
import swanlab
# 初始化一个新的swanlab实验
swanlab.init(
project="my-first-ml",
config={'learning-rate': 0.003},
)
# 记录指标
for i in range(10):
swanlab.log({"loss": i, "acc": i})
```
大功告成!前往[SwanLab](https://swanlab.cn)查看你的第一个 SwanLab 实验。
![MNIST](https://raw.githubusercontent.com/SwanHubX/swanlab/main/readme_files/readme-mnist.png)
<br>
## 💻 自托管
自托管社区版支持离线查看 SwanLab 仪表盘。
### 离线实验跟踪
在 swanlab.init 中设置`logir`和`mode`这两个参数,即可离线跟踪实验:
```python
...
swanlab.init(
logdir='./logs',
mode='local',
)
...
```
- 参数`mode`设置为`local`,关闭将实验同步到云端
- 参数`logdir`的设置是可选的,它的作用是指定了 SwanLab 日志文件的保存位置(默认保存在`swanlog`文件夹下)
- 日志文件会在跟踪实验的过程中被创建和更新,离线看板的启动也将基于这些日志文件
其他部分和云端使用完全一致。
### 开启离线看板
打开终端,使用下面的指令,开启一个 SwanLab 仪表板:
```bash
swanlab watch ./logs
```
运行完成后,SwanLab 会给你 1 个本地的 URL 链接(默认是[http://127.0.0.1:5092](http://127.0.0.1:5092))
访问该链接,就可以在浏览器用离线看板查看实验了。
<br>
## 🚗 框架集成
将您最喜欢的框架与 SwanLab 结合使用,[更多集成](https://docs.swanlab.cn/zh/guide_cloud/integration/integration-pytorch-lightning.html)。
<details>
<summary>
<strong>⚡️ PyTorch Lightning</strong>
</summary>
<br>
使用`SwanLabLogger`创建示例,并代入`Trainer`的`logger`参数中,即可实现 SwanLab 记录训练指标。
```python
from swanlab.integration.pytorch_lightning import SwanLabLogger
import importlib.util
import os
import pytorch_lightning as pl
from torch import nn, optim, utils
from torchvision.datasets import MNIST
from torchvision.transforms import ToTensor
encoder = nn.Sequential(nn.Linear(28 * 28, 128), nn.ReLU(), nn.Linear(128, 3))
decoder = nn.Sequential(nn.Linear(3, 128), nn.ReLU(), nn.Linear(128, 28 * 28))
class LitAutoEncoder(pl.LightningModule):
def __init__(self, encoder, decoder):
super().__init__()
self.encoder = encoder
self.decoder = decoder
def training_step(self, batch, batch_idx):
# training_step defines the train loop.
# it is independent of forward
x, y = batch
x = x.view(x.size(0), -1)
z = self.encoder(x)
x_hat = self.decoder(z)
loss = nn.functional.mse_loss(x_hat, x)
# Logging to SwanLab (if installed) by default
self.log("train_loss", loss)
return loss
def test_step(self, batch, batch_idx):
# test_step defines the test loop.
# it is independent of forward
x, y = batch
x = x.view(x.size(0), -1)
z = self.encoder(x)
x_hat = self.decoder(z)
loss = nn.functional.mse_loss(x_hat, x)
# Logging to SwanLab (if installed) by default
self.log("test_loss", loss)
return loss
def configure_optimizers(self):
optimizer = optim.Adam(self.parameters(), lr=1e-3)
return optimizer
# init the autoencoder
autoencoder = LitAutoEncoder(encoder, decoder)
# setup data
dataset = MNIST(os.getcwd(), train=True, download=True, transform=ToTensor())
train_dataset, val_dataset = utils.data.random_split(dataset, [55000, 5000])
test_dataset = MNIST(os.getcwd(), train=False, download=True, transform=ToTensor())
train_loader = utils.data.DataLoader(train_dataset)
val_loader = utils.data.DataLoader(val_dataset)
test_loader = utils.data.DataLoader(test_dataset)
swanlab_logger = SwanLabLogger(
project="swanlab_example",
experiment_name="example_experiment",
cloud=False,
)
trainer = pl.Trainer(limit_train_batches=100, max_epochs=5, logger=swanlab_logger)
trainer.fit(model=autoencoder, train_dataloaders=train_loader, val_dataloaders=val_loader)
trainer.test(dataloaders=test_loader)
```
</details>
<details>
<summary>
<strong> 🤗HuggingFace Transformers</strong>
</summary>
<br>
使用`SwanLabCallback`创建示例,并代入`Trainer`的`callbacks`参数中,即可实现 SwanLab 记录训练指标。
```python
import evaluate
import numpy as np
import swanlab
from swanlab.integration.huggingface import SwanLabCallback
from datasets import load_dataset
from transformers import AutoModelForSequenceClassification, AutoTokenizer, Trainer, TrainingArguments
def tokenize_function(examples):
return tokenizer(examples["text"], padding="max_length", truncation=True)
def compute_metrics(eval_pred):
logits, labels = eval_pred
predictions = np.argmax(logits, axis=-1)
return metric.compute(predictions=predictions, references=labels)
dataset = load_dataset("yelp_review_full")
tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")
tokenized_datasets = dataset.map(tokenize_function, batched=True)
small_train_dataset = tokenized_datasets["train"].shuffle(seed=42).select(range(1000))
small_eval_dataset = tokenized_datasets["test"].shuffle(seed=42).select(range(1000))
metric = evaluate.load("accuracy")
model = AutoModelForSequenceClassification.from_pretrained("bert-base-cased", num_labels=5)
training_args = TrainingArguments(
output_dir="test_trainer",
report_to="none",
num_train_epochs=3,
logging_steps=50,
)
swanlab_callback = SwanLabCallback(experiment_name="TransformersTest", cloud=False)
trainer = Trainer(
model=model,
args=training_args,
train_dataset=small_train_dataset,
eval_dataset=small_eval_dataset,
compute_metrics=compute_metrics,
callbacks=[swanlab_callback],
)
trainer.train()
```
</details>
<details>
<summary>
<strong> MMEngine(MMDetection etc.)</strong>
</summary>
<br>
将 SwanLab 专为 MMEngine 设计的`SwanlabVisBackend`集成到 MMEngine 中,即可实现 SwanLab 自动记录训练指标。
在你的 MM 配置文件中,加入下面的代码片段,开始训练即可。
```python
custom_imports = dict(imports=["swanlab.integration.mmengine"], allow_failed_imports=False)
vis_backends = [
dict(
type="SwanlabVisBackend",
save_dir="runs/swanlab",
init_kwargs={
"project": "swanlab-mmengine",
},
),
]
visualizer = dict(
type="Visualizer",
vis_backends=vis_backends,
)
```
</details>
<details>
<summary>
<strong> Ultralytics</strong>
</summary>
<br>
将 SwanLab 集成到 Ultralytics 中非常简单,只需要用`add_swanlab_callback`函数即可实现:
```python
from ultralytics import YOLO
from swanlab.integration.ultralytics import add_swanlab_callback
model = YOLO("yolov8n.yaml")
model.load()
# 添加swanlab回调
add_swanlab_callback(model)
model.train(
data="./coco.yaml",
epochs=50,
imgsz=320,
)
```
</details>
<br>
## 🆚 与熟悉的工具的比较
### Tensorboard vs SwanLab
- **☁️ 支持在线使用**:
通过 SwanLab 可以方便地将训练实验在云端在线同步与保存,便于远程查看训练进展、管理历史项目、分享实验链接、发送实时消息通知、多端看实验等。而 Tensorboard 是一个离线的实验跟踪工具。
- **👥 多人协作**:
在进行多人、跨团队的机器学习协作时,通过 SwanLab 可以轻松管理多人的训练项目、分享实验链接、跨空间交流讨论。而 Tensorboard 主要为个人设计,难以进行多人协作和分享实验。
- **💻 持久、集中的仪表板**:
无论你在何处训练模型,无论是在本地计算机上、在实验室集群还是在公有云的 GPU 实例中,你的结果都会记录到同一个集中式仪表板中。而使用 TensorBoard 需要花费时间从不同的机器复制和管理
TFEvent 文件。
- **💪 更强大的表格**:
通过 SwanLab 表格可以查看、搜索、过滤来自不同实验的结果,可以轻松查看数千个模型版本并找到适合不同任务的最佳性能模型。
TensorBoard 不适用于大型项目。
### Weights and Biases vs SwanLab
- Weights and Biases 是一个必须联网使用的闭源 MLOps 平台
- SwanLab 不仅支持联网使用,也支持开源、免费、自托管的版本
<br>
## 👥 社区
### 社区与支持
- [GitHub Issues](https://github.com/SwanHubX/SwanLab/issues):使用 SwanLab 时遇到的错误和问题
- [电子邮件支持](zeyi.lin@swanhub.co):反馈关于使用 SwanLab 的问题
- <a href="https://geektechstudio.feishu.cn/wiki/NIZ9wp5LRiSqQykizbGcVzUKnic">微信交流群</a>:交流使用 SwanLab 的问题、分享最新的 AI 技术
### SwanLab README 徽章
如果你喜欢在工作中使用 SwanLab,请将 SwanLab 徽章添加到你的 README 中:
[![swanlab](https://img.shields.io/badge/powered%20by-SwanLab-438440)](https://github.com/swanhubx/swanlab)
```
[![swanlab](https://img.shields.io/badge/powered%20by-SwanLab-438440)](https://github.com/swanhubx/swanlab)
```
### 在论文中引用 SwanLab
如果您发现 SwanLab 对您的研究之旅有帮助,请考虑以下列格式引用:
```bibtex
@software{Zeyilin_SwanLab_2023,
author = {Zeyi Lin, Shaohong Chen, Kang Li, Qiushan Jiang, Zirui Cai, Kaifang Ji and {The SwanLab team}},
doi = {10.5281/zenodo.11100550},
license = {Apache-2.0},
title = {{SwanLab}},
url = {https://github.com/swanhubx/swanlab},
year = {2023}
}
```
### 为 SwanLab 做出贡献
考虑为 SwanLab 做出贡献吗?首先,请花点时间阅读 [贡献指南](CONTRIBUTING.md)。
同时,我们非常欢迎通过社交媒体、活动和会议的分享来支持 SwanLab,衷心感谢!
### 下载 Icon
[SwanLab-Icon-SVG](https://raw.githubusercontent.com/SwanHubX/swanlab/main/readme_files/swanlab-logo.svg)
<br>
**Contributors**
<a href="https://github.com/swanhubx/swanlab/graphs/contributors">
<img src="https://contrib.rocks/image?repo=swanhubx/swanlab" />
</a>
<br>
## 📃 协议
本仓库遵循 [Apache 2.0 License](https://github.com/SwanHubX/SwanLab/blob/main/LICENSE) 开源协议
<!-- link -->
[license-shield]: https://img.shields.io/github/license/SwanHubX/SwanLab.svg?color=brightgreen
[license-shield-link]: https://github.com/SwanHubX/SwanLab/blob/main/LICENSE
[last-commit-shield]: https://img.shields.io/github/last-commit/SwanHubX/SwanLab
[last-commit-shield-link]: https://github.com/SwanHubX/SwanLab/commits/main
[pypi-version-shield]: https://img.shields.io/pypi/v/swanlab?color=orange
[pypi-version-shield-link]: https://pypi.org/project/swanlab/
[pypi-downloads-shield]: https://static.pepy.tech/badge/swanlab
[pypi-downloads-shield-link]: https://pepy.tech/project/swanlab
[issues-shield]: https://img.shields.io/github/issues/swanhubx/swanlab
[issues-shield-link]: https://github.com/swanhubx/swanlab/issues
[swanlab-cloud-shield]: https://img.shields.io/badge/Product-SwanLab云端版-636a3f
[swanlab-cloud-shield-link]: https://swanlab.cn/
[wechat-shield]: https://img.shields.io/badge/WeChat-微信-4cb55e
[wechat-shield-link]: https://geektechstudio.feishu.cn/wiki/NIZ9wp5LRiSqQykizbGcVzUKnic
[colab-shield]: https://colab.research.google.com/assets/colab-badge.svg
[colab-shield-link]: https://colab.research.google.com/drive/1RWsrY_1bS8ECzaHvYtLb_1eBkkdzekR3?usp=sharing
Raw data
{
"_id": null,
"home_page": null,
"name": "swanlab",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "machine learning, reproducibility, visualization",
"author": null,
"author_email": "Cunyue <team@swanhub.co>, Feudalman <team@swanhub.co>, ZeYi Lin <team@swanhub.co>, KashiwaByte <team@swanhub.co>",
"download_url": "https://files.pythonhosted.org/packages/45/73/96333fe79922363c53bf5309b02af07d3cf7a948e131a7a9e68120d63810/swanlab-0.4.1.tar.gz",
"platform": null,
"description": "[![Overview](https://raw.githubusercontent.com/SwanHubX/swanlab/main/readme_files/swanlab-overview-new.png)](https://swanlab.cn/)\n\n<div align=\"center\">\n\n<a href=\"https://swanlab.cn\">\ud83d\udd25SwanLab \u5728\u7ebf\u7248</a> \u00b7 <a href=\"https://docs.swanlab.cn\">\ud83d\udcc3 \u6587\u6863</a> \u00b7 <a href=\"https://github.com/swanhubx/swanlab/issues\">\u62a5\u544a\u95ee\u9898</a> \u00b7 <a href=\"https://geektechstudio.feishu.cn/share/base/form/shrcnyBlK8OMD0eweoFcc2SvWKc\">\u5efa\u8bae\u53cd\u9988</a> \u00b7 <a href=\"https://docs.swanlab.cn/zh/guide_cloud/general/changelog.html\">\u66f4\u65b0\u65e5\u5fd7</a>\n\n[![license][license-shield]][license-shield-link]\n[![last-commit][last-commit-shield]][last-commit-shield-link]\n[![pypi-version][pypi-version-shield]][pypi-version-shield-link]\n[![pypi-downloads][pypi-downloads-shield]][pypi-downloads-shield-link]\n[![issues][issues-shield]][issues-shield-link]\n<br>\n[![swanlab-cloud][swanlab-cloud-shield]][swanlab-cloud-shield-link]\n[![wechat][wechat-shield]][wechat-shield-link]\n[![colab][colab-shield]][colab-shield-link]\n\n\u4e2d\u6587 / [English](README_EN.md) / [\u65e5\u672c\u8a9e](README_JP.md) / [\u0420\u0443\u0441\u0441\u043a\u0438\u0439](README_RU.md)\n\n\ud83d\udc4b \u52a0\u5165\u6211\u4eec\u7684[\u5fae\u4fe1\u7fa4](https://docs.swanlab.cn/zh/guide_cloud/community/online-support.html)\n\n</div>\n\n\n> 2024.12.16 \n> \u4e3a\u4e86\u66f4\u597d\u5730\u53d1\u5c55SwanLab\uff0c\u6211\u4eec\u6b63\u5728\u5c06\u4e91\u7aef\u7248\u7684\u57df\u540d\u8fdb\u884c\u5907\u6848\u8fc1\u79fb\u3002 \n> \u5728\u5907\u6848\u671f\u95f4swanlab.cn\u5c06\u4f1a\u8bbf\u95ee\u5f02\u5e38\uff0c\u5927\u69822\uff5e10\u4e2a\u5de5\u4f5c\u65e5\u5185\u4f1a\u5907\u6848\u8fc1\u79fb\u5b8c\u6210\u3002 \n> \u5728\u6b64\u671f\u95f4python\u90e8\u5206\u5b9e\u9a8c\u8ddf\u8e2a\u548c\u8bb0\u5f55\u4e0d\u53d7\u5f71\u54cd\uff0c\u7f51\u9875\u7aef\u8bbf\u95ee\uff1ahttps://swanlab.115.zone \u5373\u53ef\uff0c\u611f\u8c22\u5927\u5bb6\uff01\n\n\n## \u76ee\u5f55\n\n- [\ud83d\udc4b\ud83c\udffb \u4ec0\u4e48\u662fSwanLab](#-\u4ec0\u4e48\u662fswanlab)\n- [\ud83d\udcc3 \u5728\u7ebf\u6f14\u793a](#-\u5728\u7ebf\u6f14\u793a)\n- [\ud83c\udfc1 \u5feb\u901f\u5f00\u59cb](#-\u5feb\u901f\u5f00\u59cb)\n- [\ud83d\udcbb \u81ea\u6258\u7ba1](#-\u81ea\u6258\u7ba1)\n- [\ud83d\ude97 \u6846\u67b6\u96c6\u6210](#-\u6846\u67b6\u96c6\u6210)\n- [\ud83c\udd9a \u4e0e\u719f\u6089\u7684\u5de5\u5177\u7684\u6bd4\u8f83](#-\u4e0e\u719f\u6089\u7684\u5de5\u5177\u7684\u6bd4\u8f83)\n- [\ud83d\udc65 \u793e\u533a](#-\u793e\u533a)\n- [\ud83d\udcc3 \u534f\u8bae](#-\u534f\u8bae)\n\n<br/>\n\n## \ud83d\udc4b\ud83c\udffb \u4ec0\u4e48\u662fSwanLab\n\nSwanLab \u662f\u4e00\u6b3e\u5f00\u6e90\u3001\u8f7b\u91cf\u7684 AI \u5b9e\u9a8c\u8ddf\u8e2a\u5de5\u5177\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u8ddf\u8e2a\u3001\u6bd4\u8f83\u3001\u548c\u534f\u4f5c\u5b9e\u9a8c\u7684\u5e73\u53f0\u3002\n\nSwanLab \u63d0\u4f9b\u4e86\u53cb\u597d\u7684 API \u548c\u6f02\u4eae\u7684\u754c\u9762\uff0c\u7ed3\u5408\u4e86\u8d85\u53c2\u6570\u8ddf\u8e2a\u3001\u6307\u6807\u8bb0\u5f55\u3001\u5728\u7ebf\u534f\u4f5c\u3001\u5b9e\u9a8c\u94fe\u63a5\u5206\u4eab\u7b49\u529f\u80fd\uff0c\u8ba9\u60a8\u53ef\u4ee5\u5feb\u901f\u8ddf\u8e2a AI \u5b9e\u9a8c\u3001\u53ef\u89c6\u5316\u8fc7\u7a0b\u3001\u8bb0\u5f55\u8d85\u53c2\u6570\uff0c\u5e76\u5206\u4eab\u7ed9\u4f19\u4f34\u3002\n\n\u4ee5\u4e0b\u662f\u5176\u6838\u5fc3\u7279\u6027\u5217\u8868\uff1a\n\n**1. \ud83d\udcca \u5b9e\u9a8c\u6307\u6807\u4e0e\u8d85\u53c2\u6570\u8ddf\u8e2a**: \u6781\u7b80\u7684\u4ee3\u7801\u5d4c\u5165\u60a8\u7684\u673a\u5668\u5b66\u4e60 pipeline\uff0c\u8ddf\u8e2a\u8bb0\u5f55\u8bad\u7ec3\u5173\u952e\u6307\u6807\n\n- \u81ea\u7531\u7684\u8d85\u53c2\u6570\u4e0e\u5b9e\u9a8c\u914d\u7f6e\u8bb0\u5f55\n- \u652f\u6301\u7684\u5143\u6570\u636e\u7c7b\u578b\uff1a\u6807\u91cf\u6307\u6807\u3001\u56fe\u50cf\u3001\u97f3\u9891\u3001\u6587\u672c\u3001...\n- \u652f\u6301\u7684\u56fe\u8868\u7c7b\u578b\uff1a\u6298\u7ebf\u56fe\u3001\u5a92\u4f53\u56fe\uff08\u56fe\u50cf\u3001\u97f3\u9891\u3001\u6587\u672c\uff09\u3001...\n- \u81ea\u52a8\u8bb0\u5f55\uff1a\u63a7\u5236\u53f0 logging\u3001GPU \u786c\u4ef6\u3001Git \u4fe1\u606f\u3001Python \u89e3\u91ca\u5668\u3001Python \u5e93\u5217\u8868\u3001\u4ee3\u7801\u76ee\u5f55\n\n![](https://raw.githubusercontent.com/SwanHubX/swanlab/main/readme_files/overview-2.png)\n\n**2. \u26a1\ufe0f \u5168\u9762\u7684\u6846\u67b6\u96c6\u6210**: PyTorch\u3001Tensorflow\u3001PyTorch Lightning\u3001\ud83e\udd17HuggingFace\u3001Transformers\u3001MMEngine\u3001Ultralytics\u3001fastai\u3001Tensorboard\u3001OpenAI\u3001ZhipuAI\u3001Hydra\u3001...\n\n**3. \ud83d\udce6 \u7ec4\u7ec7\u5b9e\u9a8c**: \u96c6\u4e2d\u5f0f\u4eea\u8868\u677f\uff0c\u5feb\u901f\u7ba1\u7406\u591a\u4e2a\u9879\u76ee\u4e0e\u5b9e\u9a8c\uff0c\u901a\u8fc7\u6574\u4f53\u89c6\u56fe\u901f\u89c8\u8bad\u7ec3\u5168\u5c40\n\n**4. \ud83c\udd9a \u6bd4\u8f83\u7ed3\u679c**: \u901a\u8fc7\u5728\u7ebf\u8868\u683c\u4e0e\u5bf9\u6bd4\u56fe\u8868\u6bd4\u8f83\u4e0d\u540c\u5b9e\u9a8c\u7684\u8d85\u53c2\u6570\u548c\u7ed3\u679c\uff0c\u6316\u6398\u8fed\u4ee3\u7075\u611f\n\n**5. \ud83d\udc65 \u5728\u7ebf\u534f\u4f5c**: \u60a8\u53ef\u4ee5\u4e0e\u56e2\u961f\u8fdb\u884c\u534f\u4f5c\u5f0f\u8bad\u7ec3\uff0c\u652f\u6301\u5c06\u5b9e\u9a8c\u5b9e\u65f6\u540c\u6b65\u5728\u4e00\u4e2a\u9879\u76ee\u4e0b\uff0c\u60a8\u53ef\u4ee5\u5728\u7ebf\u67e5\u770b\u56e2\u961f\u7684\u8bad\u7ec3\u8bb0\u5f55\uff0c\u57fa\u4e8e\u7ed3\u679c\u53d1\u8868\u770b\u6cd5\u4e0e\u5efa\u8bae\n\n**6. \u2709\ufe0f \u5206\u4eab\u7ed3\u679c**: \u590d\u5236\u548c\u53d1\u9001\u6301\u4e45\u7684 URL \u6765\u5171\u4eab\u6bcf\u4e2a\u5b9e\u9a8c\uff0c\u65b9\u4fbf\u5730\u53d1\u9001\u7ed9\u4f19\u4f34\uff0c\u6216\u5d4c\u5165\u5230\u5728\u7ebf\u7b14\u8bb0\u4e2d\n\n**7. \ud83d\udcbb \u652f\u6301\u81ea\u6258\u7ba1**: \u652f\u6301\u4e0d\u8054\u7f51\u4f7f\u7528\uff0c\u81ea\u6258\u7ba1\u7684\u793e\u533a\u7248\u540c\u6837\u53ef\u4ee5\u67e5\u770b\u4eea\u8868\u76d8\u4e0e\u7ba1\u7406\u5b9e\u9a8c\n\n> \\[!IMPORTANT]\n>\n> **\u6536\u85cf\u9879\u76ee**\uff0c\u4f60\u5c06\u4ece GitHub \u4e0a\u65e0\u5ef6\u8fdf\u5730\u63a5\u6536\u6240\u6709\u53d1\u5e03\u901a\u77e5\uff5e \u2b50\ufe0f\n\n![star-us](https://raw.githubusercontent.com/SwanHubX/swanlab/main/readme_files/star-us.png)\n\n<br>\n\n## \ud83d\udcc3 \u5728\u7ebf\u6f14\u793a\n\n\u6765\u770b\u770b SwanLab \u7684\u5728\u7ebf\u6f14\u793a\uff1a\n\n| [ResNet50 \u732b\u72d7\u5206\u7c7b](https://swanlab.cn/@ZeyiLin/Cats_Dogs_Classification/runs/jzo93k112f15pmx14vtxf/chart) | [Yolov8-COCO128 \u76ee\u6807\u68c0\u6d4b](https://swanlab.cn/@ZeyiLin/ultratest/runs/yux7vclmsmmsar9ear7u5/chart) |\n| :----------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------: |\n| <a href=\"https://swanlab.cn/@ZeyiLin/Cats_Dogs_Classification/runs/jzo93k112f15pmx14vtxf/chart\"> <img src=\"https://raw.githubusercontent.com/SwanHubX/swanlab/main/readme_files/example-mnist.png\"> </a> | <a href=\"https://swanlab.cn/@ZeyiLin/ultratest/runs/yux7vclmsmmsar9ear7u5/chart\"> <img src=\"https://raw.githubusercontent.com/SwanHubX/swanlab/main/readme_files/example-yolo.png\"> </a> |\n| \u8ddf\u8e2a\u4e00\u4e2a\u7b80\u5355\u7684 ResNet50 \u6a21\u578b\u5728\u732b\u72d7\u6570\u636e\u96c6\u4e0a\u8bad\u7ec3\u7684\u56fe\u50cf\u5206\u7c7b\u4efb\u52a1\u3002 | \u4f7f\u7528 Yolov8 \u5728 COCO128 \u6570\u636e\u96c6\u4e0a\u8fdb\u884c\u76ee\u6807\u68c0\u6d4b\u4efb\u52a1\uff0c\u8ddf\u8e2a\u8bad\u7ec3\u8d85\u53c2\u6570\u548c\u6307\u6807\u3002 |\n\n| [Qwen2 \u6307\u4ee4\u5fae\u8c03](https://swanlab.cn/@ZeyiLin/Qwen2-fintune/runs/cfg5f8dzkp6vouxzaxlx6/chart) | [LSTM Google \u80a1\u7968\u9884\u6d4b](https://swanlab.cn/@ZeyiLin/Google-Stock-Prediction/charts) |\n| :-----------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------: |\n| <a href=\"https://swanlab.cn/@ZeyiLin/Qwen2-fintune/runs/cfg5f8dzkp6vouxzaxlx6/chart\"> <img src=\"https://raw.githubusercontent.com/SwanHubX/swanlab/main/readme_files/example-qwen2.png\"> </a> | <a href=\"https://swanlab.cn/@ZeyiLin/Google-Stock-Prediction/charts\"> <img src=\"https://raw.githubusercontent.com/SwanHubX/swanlab/main/readme_files/example-lstm.png\"> </a> |\n| \u8ddf\u8e2a Qwen2 \u5927\u8bed\u8a00\u6a21\u578b\u7684\u6307\u4ee4\u5fae\u8c03\u8bad\u7ec3\uff0c\u5b8c\u6210\u7b80\u5355\u7684\u6307\u4ee4\u9075\u5faa\u3002 | \u4f7f\u7528\u7b80\u5355\u7684 LSTM \u6a21\u578b\u5728 Google \u80a1\u4ef7\u6570\u636e\u96c6\u4e0a\u8bad\u7ec3\uff0c\u5b9e\u73b0\u5bf9\u672a\u6765\u80a1\u4ef7\u7684\u9884\u6d4b\u3002 |\n\n[\u66f4\u591a\u6848\u4f8b](https://docs.swanlab.cn/zh/examples/mnist.html)\n\n<br>\n\n## \ud83c\udfc1 \u5feb\u901f\u5f00\u59cb\n\n### 1.\u5b89\u88c5\n\n```bash\npip install swanlab\n```\n\n### 2.\u767b\u5f55\u5e76\u83b7\u53d6 API Key\n\n1. \u514d\u8d39[\u6ce8\u518c\u8d26\u53f7](https://swanlab.cn)\n\n2. \u767b\u5f55\u8d26\u53f7\uff0c\u5728\u7528\u6237\u8bbe\u7f6e > [API Key](https://swanlab.cn/settings) \u91cc\u590d\u5236\u60a8\u7684 API Key\n\n3. \u6253\u5f00\u7ec8\u7aef\uff0c\u8f93\u5165\uff1a\n\n```bash\nswanlab login\n```\n\n\u51fa\u73b0\u63d0\u793a\u65f6\uff0c\u8f93\u5165\u60a8\u7684 API Key\uff0c\u6309\u4e0b\u56de\u8f66\uff0c\u5b8c\u6210\u767b\u9646\u3002\n\n### 3.\u5c06 SwanLab \u4e0e\u4f60\u7684\u4ee3\u7801\u96c6\u6210\n\n```python\nimport swanlab\n\n# \u521d\u59cb\u5316\u4e00\u4e2a\u65b0\u7684swanlab\u5b9e\u9a8c\nswanlab.init(\n project=\"my-first-ml\",\n config={'learning-rate': 0.003},\n)\n\n# \u8bb0\u5f55\u6307\u6807\nfor i in range(10):\n swanlab.log({\"loss\": i, \"acc\": i})\n```\n\n\u5927\u529f\u544a\u6210\uff01\u524d\u5f80[SwanLab](https://swanlab.cn)\u67e5\u770b\u4f60\u7684\u7b2c\u4e00\u4e2a SwanLab \u5b9e\u9a8c\u3002\n\n![MNIST](https://raw.githubusercontent.com/SwanHubX/swanlab/main/readme_files/readme-mnist.png)\n\n<br>\n\n## \ud83d\udcbb \u81ea\u6258\u7ba1\n\n\u81ea\u6258\u7ba1\u793e\u533a\u7248\u652f\u6301\u79bb\u7ebf\u67e5\u770b SwanLab \u4eea\u8868\u76d8\u3002\n\n### \u79bb\u7ebf\u5b9e\u9a8c\u8ddf\u8e2a\n\n\u5728 swanlab.init \u4e2d\u8bbe\u7f6e`logir`\u548c`mode`\u8fd9\u4e24\u4e2a\u53c2\u6570\uff0c\u5373\u53ef\u79bb\u7ebf\u8ddf\u8e2a\u5b9e\u9a8c\uff1a\n\n```python\n...\n\nswanlab.init(\n logdir='./logs',\n mode='local',\n)\n\n...\n```\n\n- \u53c2\u6570`mode`\u8bbe\u7f6e\u4e3a`local`\uff0c\u5173\u95ed\u5c06\u5b9e\u9a8c\u540c\u6b65\u5230\u4e91\u7aef\n\n- \u53c2\u6570`logdir`\u7684\u8bbe\u7f6e\u662f\u53ef\u9009\u7684\uff0c\u5b83\u7684\u4f5c\u7528\u662f\u6307\u5b9a\u4e86 SwanLab \u65e5\u5fd7\u6587\u4ef6\u7684\u4fdd\u5b58\u4f4d\u7f6e\uff08\u9ed8\u8ba4\u4fdd\u5b58\u5728`swanlog`\u6587\u4ef6\u5939\u4e0b\uff09\n\n - \u65e5\u5fd7\u6587\u4ef6\u4f1a\u5728\u8ddf\u8e2a\u5b9e\u9a8c\u7684\u8fc7\u7a0b\u4e2d\u88ab\u521b\u5efa\u548c\u66f4\u65b0\uff0c\u79bb\u7ebf\u770b\u677f\u7684\u542f\u52a8\u4e5f\u5c06\u57fa\u4e8e\u8fd9\u4e9b\u65e5\u5fd7\u6587\u4ef6\n\n\u5176\u4ed6\u90e8\u5206\u548c\u4e91\u7aef\u4f7f\u7528\u5b8c\u5168\u4e00\u81f4\u3002\n\n### \u5f00\u542f\u79bb\u7ebf\u770b\u677f\n\n\u6253\u5f00\u7ec8\u7aef\uff0c\u4f7f\u7528\u4e0b\u9762\u7684\u6307\u4ee4\uff0c\u5f00\u542f\u4e00\u4e2a SwanLab \u4eea\u8868\u677f:\n\n```bash\nswanlab watch ./logs\n```\n\n\u8fd0\u884c\u5b8c\u6210\u540e\uff0cSwanLab \u4f1a\u7ed9\u4f60 1 \u4e2a\u672c\u5730\u7684 URL \u94fe\u63a5\uff08\u9ed8\u8ba4\u662f[http://127.0.0.1:5092](http://127.0.0.1:5092)\uff09\n\n\u8bbf\u95ee\u8be5\u94fe\u63a5\uff0c\u5c31\u53ef\u4ee5\u5728\u6d4f\u89c8\u5668\u7528\u79bb\u7ebf\u770b\u677f\u67e5\u770b\u5b9e\u9a8c\u4e86\u3002\n\n<br>\n\n## \ud83d\ude97 \u6846\u67b6\u96c6\u6210\n\n\u5c06\u60a8\u6700\u559c\u6b22\u7684\u6846\u67b6\u4e0e SwanLab \u7ed3\u5408\u4f7f\u7528\uff0c[\u66f4\u591a\u96c6\u6210](https://docs.swanlab.cn/zh/guide_cloud/integration/integration-pytorch-lightning.html)\u3002\n\n<details>\n <summary>\n <strong>\u26a1\ufe0f PyTorch Lightning</strong>\n </summary>\n <br>\n\n\u4f7f\u7528`SwanLabLogger`\u521b\u5efa\u793a\u4f8b\uff0c\u5e76\u4ee3\u5165`Trainer`\u7684`logger`\u53c2\u6570\u4e2d\uff0c\u5373\u53ef\u5b9e\u73b0 SwanLab \u8bb0\u5f55\u8bad\u7ec3\u6307\u6807\u3002\n\n```python\nfrom swanlab.integration.pytorch_lightning import SwanLabLogger\nimport importlib.util\nimport os\nimport pytorch_lightning as pl\nfrom torch import nn, optim, utils\nfrom torchvision.datasets import MNIST\nfrom torchvision.transforms import ToTensor\n\nencoder = nn.Sequential(nn.Linear(28 * 28, 128), nn.ReLU(), nn.Linear(128, 3))\ndecoder = nn.Sequential(nn.Linear(3, 128), nn.ReLU(), nn.Linear(128, 28 * 28))\n\n\nclass LitAutoEncoder(pl.LightningModule):\n def __init__(self, encoder, decoder):\n super().__init__()\n self.encoder = encoder\n self.decoder = decoder\n\n def training_step(self, batch, batch_idx):\n # training_step defines the train loop.\n # it is independent of forward\n x, y = batch\n x = x.view(x.size(0), -1)\n z = self.encoder(x)\n x_hat = self.decoder(z)\n loss = nn.functional.mse_loss(x_hat, x)\n # Logging to SwanLab (if installed) by default\n self.log(\"train_loss\", loss)\n return loss\n\n def test_step(self, batch, batch_idx):\n # test_step defines the test loop.\n # it is independent of forward\n x, y = batch\n x = x.view(x.size(0), -1)\n z = self.encoder(x)\n x_hat = self.decoder(z)\n loss = nn.functional.mse_loss(x_hat, x)\n # Logging to SwanLab (if installed) by default\n self.log(\"test_loss\", loss)\n return loss\n\n def configure_optimizers(self):\n optimizer = optim.Adam(self.parameters(), lr=1e-3)\n return optimizer\n\n\n# init the autoencoder\nautoencoder = LitAutoEncoder(encoder, decoder)\n\n# setup data\ndataset = MNIST(os.getcwd(), train=True, download=True, transform=ToTensor())\ntrain_dataset, val_dataset = utils.data.random_split(dataset, [55000, 5000])\ntest_dataset = MNIST(os.getcwd(), train=False, download=True, transform=ToTensor())\n\ntrain_loader = utils.data.DataLoader(train_dataset)\nval_loader = utils.data.DataLoader(val_dataset)\ntest_loader = utils.data.DataLoader(test_dataset)\n\nswanlab_logger = SwanLabLogger(\n project=\"swanlab_example\",\n experiment_name=\"example_experiment\",\n cloud=False,\n)\n\ntrainer = pl.Trainer(limit_train_batches=100, max_epochs=5, logger=swanlab_logger)\n\ntrainer.fit(model=autoencoder, train_dataloaders=train_loader, val_dataloaders=val_loader)\ntrainer.test(dataloaders=test_loader)\n\n```\n\n</details>\n\n<details>\n<summary>\n <strong> \ud83e\udd17HuggingFace Transformers</strong>\n</summary>\n\n<br>\n\n\u4f7f\u7528`SwanLabCallback`\u521b\u5efa\u793a\u4f8b\uff0c\u5e76\u4ee3\u5165`Trainer`\u7684`callbacks`\u53c2\u6570\u4e2d\uff0c\u5373\u53ef\u5b9e\u73b0 SwanLab \u8bb0\u5f55\u8bad\u7ec3\u6307\u6807\u3002\n\n```python\nimport evaluate\nimport numpy as np\nimport swanlab\nfrom swanlab.integration.huggingface import SwanLabCallback\nfrom datasets import load_dataset\nfrom transformers import AutoModelForSequenceClassification, AutoTokenizer, Trainer, TrainingArguments\n\n\ndef tokenize_function(examples):\n return tokenizer(examples[\"text\"], padding=\"max_length\", truncation=True)\n\n\ndef compute_metrics(eval_pred):\n logits, labels = eval_pred\n predictions = np.argmax(logits, axis=-1)\n return metric.compute(predictions=predictions, references=labels)\n\n\ndataset = load_dataset(\"yelp_review_full\")\n\ntokenizer = AutoTokenizer.from_pretrained(\"bert-base-cased\")\n\ntokenized_datasets = dataset.map(tokenize_function, batched=True)\n\nsmall_train_dataset = tokenized_datasets[\"train\"].shuffle(seed=42).select(range(1000))\nsmall_eval_dataset = tokenized_datasets[\"test\"].shuffle(seed=42).select(range(1000))\n\nmetric = evaluate.load(\"accuracy\")\n\nmodel = AutoModelForSequenceClassification.from_pretrained(\"bert-base-cased\", num_labels=5)\n\ntraining_args = TrainingArguments(\n output_dir=\"test_trainer\",\n report_to=\"none\",\n num_train_epochs=3,\n logging_steps=50,\n)\n\nswanlab_callback = SwanLabCallback(experiment_name=\"TransformersTest\", cloud=False)\n\ntrainer = Trainer(\n model=model,\n args=training_args,\n train_dataset=small_train_dataset,\n eval_dataset=small_eval_dataset,\n compute_metrics=compute_metrics,\n callbacks=[swanlab_callback],\n)\n\ntrainer.train()\n```\n\n</details>\n\n<details>\n<summary>\n <strong> MMEngine(MMDetection etc.)</strong>\n</summary>\n<br>\n\n\u5c06 SwanLab \u4e13\u4e3a MMEngine \u8bbe\u8ba1\u7684`SwanlabVisBackend`\u96c6\u6210\u5230 MMEngine \u4e2d\uff0c\u5373\u53ef\u5b9e\u73b0 SwanLab \u81ea\u52a8\u8bb0\u5f55\u8bad\u7ec3\u6307\u6807\u3002\n\n\u5728\u4f60\u7684 MM \u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u52a0\u5165\u4e0b\u9762\u7684\u4ee3\u7801\u7247\u6bb5\uff0c\u5f00\u59cb\u8bad\u7ec3\u5373\u53ef\u3002\n\n```python\ncustom_imports = dict(imports=[\"swanlab.integration.mmengine\"], allow_failed_imports=False)\n\nvis_backends = [\n dict(\n type=\"SwanlabVisBackend\",\n save_dir=\"runs/swanlab\",\n init_kwargs={\n \"project\": \"swanlab-mmengine\",\n },\n ),\n]\n\nvisualizer = dict(\n type=\"Visualizer\",\n vis_backends=vis_backends,\n)\n```\n\n</details>\n\n<details>\n<summary>\n <strong> Ultralytics</strong>\n</summary>\n<br>\n\n\u5c06 SwanLab \u96c6\u6210\u5230 Ultralytics \u4e2d\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u7528`add_swanlab_callback`\u51fd\u6570\u5373\u53ef\u5b9e\u73b0:\n\n```python\nfrom ultralytics import YOLO\nfrom swanlab.integration.ultralytics import add_swanlab_callback\n\nmodel = YOLO(\"yolov8n.yaml\")\nmodel.load()\n\n# \u6dfb\u52a0swanlab\u56de\u8c03\nadd_swanlab_callback(model)\n\nmodel.train(\n data=\"./coco.yaml\",\n epochs=50,\n imgsz=320,\n)\n```\n\n</details>\n\n<br>\n\n## \ud83c\udd9a \u4e0e\u719f\u6089\u7684\u5de5\u5177\u7684\u6bd4\u8f83\n\n### Tensorboard vs SwanLab\n\n- **\u2601\ufe0f \u652f\u6301\u5728\u7ebf\u4f7f\u7528**\uff1a\n \u901a\u8fc7 SwanLab \u53ef\u4ee5\u65b9\u4fbf\u5730\u5c06\u8bad\u7ec3\u5b9e\u9a8c\u5728\u4e91\u7aef\u5728\u7ebf\u540c\u6b65\u4e0e\u4fdd\u5b58\uff0c\u4fbf\u4e8e\u8fdc\u7a0b\u67e5\u770b\u8bad\u7ec3\u8fdb\u5c55\u3001\u7ba1\u7406\u5386\u53f2\u9879\u76ee\u3001\u5206\u4eab\u5b9e\u9a8c\u94fe\u63a5\u3001\u53d1\u9001\u5b9e\u65f6\u6d88\u606f\u901a\u77e5\u3001\u591a\u7aef\u770b\u5b9e\u9a8c\u7b49\u3002\u800c Tensorboard \u662f\u4e00\u4e2a\u79bb\u7ebf\u7684\u5b9e\u9a8c\u8ddf\u8e2a\u5de5\u5177\u3002\n\n- **\ud83d\udc65 \u591a\u4eba\u534f\u4f5c**\uff1a\n \u5728\u8fdb\u884c\u591a\u4eba\u3001\u8de8\u56e2\u961f\u7684\u673a\u5668\u5b66\u4e60\u534f\u4f5c\u65f6\uff0c\u901a\u8fc7 SwanLab \u53ef\u4ee5\u8f7b\u677e\u7ba1\u7406\u591a\u4eba\u7684\u8bad\u7ec3\u9879\u76ee\u3001\u5206\u4eab\u5b9e\u9a8c\u94fe\u63a5\u3001\u8de8\u7a7a\u95f4\u4ea4\u6d41\u8ba8\u8bba\u3002\u800c Tensorboard \u4e3b\u8981\u4e3a\u4e2a\u4eba\u8bbe\u8ba1\uff0c\u96be\u4ee5\u8fdb\u884c\u591a\u4eba\u534f\u4f5c\u548c\u5206\u4eab\u5b9e\u9a8c\u3002\n\n- **\ud83d\udcbb \u6301\u4e45\u3001\u96c6\u4e2d\u7684\u4eea\u8868\u677f**\uff1a\n \u65e0\u8bba\u4f60\u5728\u4f55\u5904\u8bad\u7ec3\u6a21\u578b\uff0c\u65e0\u8bba\u662f\u5728\u672c\u5730\u8ba1\u7b97\u673a\u4e0a\u3001\u5728\u5b9e\u9a8c\u5ba4\u96c6\u7fa4\u8fd8\u662f\u5728\u516c\u6709\u4e91\u7684 GPU \u5b9e\u4f8b\u4e2d\uff0c\u4f60\u7684\u7ed3\u679c\u90fd\u4f1a\u8bb0\u5f55\u5230\u540c\u4e00\u4e2a\u96c6\u4e2d\u5f0f\u4eea\u8868\u677f\u4e2d\u3002\u800c\u4f7f\u7528 TensorBoard \u9700\u8981\u82b1\u8d39\u65f6\u95f4\u4ece\u4e0d\u540c\u7684\u673a\u5668\u590d\u5236\u548c\u7ba1\u7406\n TFEvent \u6587\u4ef6\u3002\n\n- **\ud83d\udcaa \u66f4\u5f3a\u5927\u7684\u8868\u683c**\uff1a\n \u901a\u8fc7 SwanLab \u8868\u683c\u53ef\u4ee5\u67e5\u770b\u3001\u641c\u7d22\u3001\u8fc7\u6ee4\u6765\u81ea\u4e0d\u540c\u5b9e\u9a8c\u7684\u7ed3\u679c\uff0c\u53ef\u4ee5\u8f7b\u677e\u67e5\u770b\u6570\u5343\u4e2a\u6a21\u578b\u7248\u672c\u5e76\u627e\u5230\u9002\u5408\u4e0d\u540c\u4efb\u52a1\u7684\u6700\u4f73\u6027\u80fd\u6a21\u578b\u3002\n TensorBoard \u4e0d\u9002\u7528\u4e8e\u5927\u578b\u9879\u76ee\u3002\n\n### Weights and Biases vs SwanLab\n\n- Weights and Biases \u662f\u4e00\u4e2a\u5fc5\u987b\u8054\u7f51\u4f7f\u7528\u7684\u95ed\u6e90 MLOps \u5e73\u53f0\n\n- SwanLab \u4e0d\u4ec5\u652f\u6301\u8054\u7f51\u4f7f\u7528\uff0c\u4e5f\u652f\u6301\u5f00\u6e90\u3001\u514d\u8d39\u3001\u81ea\u6258\u7ba1\u7684\u7248\u672c\n\n<br>\n\n## \ud83d\udc65 \u793e\u533a\n\n### \u793e\u533a\u4e0e\u652f\u6301\n\n- [GitHub Issues](https://github.com/SwanHubX/SwanLab/issues)\uff1a\u4f7f\u7528 SwanLab \u65f6\u9047\u5230\u7684\u9519\u8bef\u548c\u95ee\u9898\n- [\u7535\u5b50\u90ae\u4ef6\u652f\u6301](zeyi.lin@swanhub.co)\uff1a\u53cd\u9988\u5173\u4e8e\u4f7f\u7528 SwanLab \u7684\u95ee\u9898\n- <a href=\"https://geektechstudio.feishu.cn/wiki/NIZ9wp5LRiSqQykizbGcVzUKnic\">\u5fae\u4fe1\u4ea4\u6d41\u7fa4</a>\uff1a\u4ea4\u6d41\u4f7f\u7528 SwanLab \u7684\u95ee\u9898\u3001\u5206\u4eab\u6700\u65b0\u7684 AI \u6280\u672f\n\n### SwanLab README \u5fbd\u7ae0\n\n\u5982\u679c\u4f60\u559c\u6b22\u5728\u5de5\u4f5c\u4e2d\u4f7f\u7528 SwanLab\uff0c\u8bf7\u5c06 SwanLab \u5fbd\u7ae0\u6dfb\u52a0\u5230\u4f60\u7684 README \u4e2d\uff1a\n\n[![swanlab](https://img.shields.io/badge/powered%20by-SwanLab-438440)](https://github.com/swanhubx/swanlab)\n\n```\n[![swanlab](https://img.shields.io/badge/powered%20by-SwanLab-438440)](https://github.com/swanhubx/swanlab)\n```\n\n### \u5728\u8bba\u6587\u4e2d\u5f15\u7528 SwanLab\n\n\u5982\u679c\u60a8\u53d1\u73b0 SwanLab \u5bf9\u60a8\u7684\u7814\u7a76\u4e4b\u65c5\u6709\u5e2e\u52a9\uff0c\u8bf7\u8003\u8651\u4ee5\u4e0b\u5217\u683c\u5f0f\u5f15\u7528\uff1a\n\n```bibtex\n@software{Zeyilin_SwanLab_2023,\n author = {Zeyi Lin, Shaohong Chen, Kang Li, Qiushan Jiang, Zirui Cai, Kaifang Ji and {The SwanLab team}},\n doi = {10.5281/zenodo.11100550},\n license = {Apache-2.0},\n title = {{SwanLab}},\n url = {https://github.com/swanhubx/swanlab},\n year = {2023}\n}\n```\n\n### \u4e3a SwanLab \u505a\u51fa\u8d21\u732e\n\n\u8003\u8651\u4e3a SwanLab \u505a\u51fa\u8d21\u732e\u5417\uff1f\u9996\u5148\uff0c\u8bf7\u82b1\u70b9\u65f6\u95f4\u9605\u8bfb [\u8d21\u732e\u6307\u5357](CONTRIBUTING.md)\u3002\n\n\u540c\u65f6\uff0c\u6211\u4eec\u975e\u5e38\u6b22\u8fce\u901a\u8fc7\u793e\u4ea4\u5a92\u4f53\u3001\u6d3b\u52a8\u548c\u4f1a\u8bae\u7684\u5206\u4eab\u6765\u652f\u6301 SwanLab\uff0c\u8877\u5fc3\u611f\u8c22\uff01\n\n### \u4e0b\u8f7d Icon\n\n[SwanLab-Icon-SVG](https://raw.githubusercontent.com/SwanHubX/swanlab/main/readme_files/swanlab-logo.svg)\n\n<br>\n\n**Contributors**\n\n<a href=\"https://github.com/swanhubx/swanlab/graphs/contributors\">\n <img src=\"https://contrib.rocks/image?repo=swanhubx/swanlab\" />\n</a>\n\n<br>\n\n## \ud83d\udcc3 \u534f\u8bae\n\n\u672c\u4ed3\u5e93\u9075\u5faa [Apache 2.0 License](https://github.com/SwanHubX/SwanLab/blob/main/LICENSE) \u5f00\u6e90\u534f\u8bae\n\n<!-- link -->\n\n[license-shield]: https://img.shields.io/github/license/SwanHubX/SwanLab.svg?color=brightgreen\n[license-shield-link]: https://github.com/SwanHubX/SwanLab/blob/main/LICENSE\n[last-commit-shield]: https://img.shields.io/github/last-commit/SwanHubX/SwanLab\n[last-commit-shield-link]: https://github.com/SwanHubX/SwanLab/commits/main\n[pypi-version-shield]: https://img.shields.io/pypi/v/swanlab?color=orange\n[pypi-version-shield-link]: https://pypi.org/project/swanlab/\n[pypi-downloads-shield]: https://static.pepy.tech/badge/swanlab\n[pypi-downloads-shield-link]: https://pepy.tech/project/swanlab\n[issues-shield]: https://img.shields.io/github/issues/swanhubx/swanlab\n[issues-shield-link]: https://github.com/swanhubx/swanlab/issues\n[swanlab-cloud-shield]: https://img.shields.io/badge/Product-SwanLab\u4e91\u7aef\u7248-636a3f\n[swanlab-cloud-shield-link]: https://swanlab.cn/\n[wechat-shield]: https://img.shields.io/badge/WeChat-\u5fae\u4fe1-4cb55e\n[wechat-shield-link]: https://geektechstudio.feishu.cn/wiki/NIZ9wp5LRiSqQykizbGcVzUKnic\n[colab-shield]: https://colab.research.google.com/assets/colab-badge.svg\n[colab-shield-link]: https://colab.research.google.com/drive/1RWsrY_1bS8ECzaHvYtLb_1eBkkdzekR3?usp=sharing\n",
"bugtrack_url": null,
"license": null,
"summary": "Python library for streamlined tracking and management of AI training processes.",
"version": "0.4.1",
"project_urls": {
"Bug Reports": "https://github.com/SwanHubX/SwanLab/issues",
"Documentation": "https://docs.swanlab.cn/zh/guide_cloud/general/what-is-swanlab.html",
"Homepage": "https://swanlab.cn",
"Source": "https://github.com/SwanHubX/SwanLab"
},
"split_keywords": [
"machine learning",
" reproducibility",
" visualization"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bba5677f1f7bef165fc7dff6a5cd7ab1800f90b77b24e694f3e7824455c0718a",
"md5": "3bb886e0cb4ff726640ce2453a55a14b",
"sha256": "efc84a5f0f620e29b93e3977802c768eac4a7a48b6f926e627147243ac9979ec"
},
"downloads": -1,
"filename": "swanlab-0.4.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3bb886e0cb4ff726640ce2453a55a14b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 167739,
"upload_time": "2024-12-21T07:23:48",
"upload_time_iso_8601": "2024-12-21T07:23:48.606051Z",
"url": "https://files.pythonhosted.org/packages/bb/a5/677f1f7bef165fc7dff6a5cd7ab1800f90b77b24e694f3e7824455c0718a/swanlab-0.4.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "457396333fe79922363c53bf5309b02af07d3cf7a948e131a7a9e68120d63810",
"md5": "451034d625a51072218b4fe2b6faf6fe",
"sha256": "4a5e593aa024f2c192220126ddeb27e4164512d68a00449208ac71153ee20ada"
},
"downloads": -1,
"filename": "swanlab-0.4.1.tar.gz",
"has_sig": false,
"md5_digest": "451034d625a51072218b4fe2b6faf6fe",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 150331,
"upload_time": "2024-12-21T07:23:51",
"upload_time_iso_8601": "2024-12-21T07:23:51.764898Z",
"url": "https://files.pythonhosted.org/packages/45/73/96333fe79922363c53bf5309b02af07d3cf7a948e131a7a9e68120d63810/swanlab-0.4.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-21 07:23:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "SwanHubX",
"github_project": "SwanLab",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "swankit",
"specs": [
[
"==",
"0.1.2b6"
]
]
},
{
"name": "swanboard",
"specs": [
[
"==",
"0.1.7b1"
]
]
},
{
"name": "cos-python-sdk-v5",
"specs": []
},
{
"name": "urllib3",
"specs": [
[
">=",
"1.26.0"
]
]
},
{
"name": "requests",
"specs": [
[
">=",
"2.25.0"
]
]
},
{
"name": "click",
"specs": []
},
{
"name": "pyyaml",
"specs": []
},
{
"name": "psutil",
"specs": [
[
">=",
"5.0.0"
]
]
},
{
"name": "pynvml",
"specs": []
},
{
"name": "rich",
"specs": []
}
],
"lcname": "swanlab"
}