Skip to content

[BUG] local模式下的swanlog日志文件,sync会缺失内容 #1093

@Zeyi-Lin

Description

@Zeyi-Lin

🐛 Bug description [Please make everyone to understand it]

如果将mode设置为local,跑如下的样例代码:

import swanlab
import random

# 创建一个SwanLab项目
swanlab.init(
    # 设置项目名
    project="my-awesome-project",
    
    # 设置超参数
    config={
        "learning_rate": 0.02,
        "architecture": "CNN",
        "dataset": "CIFAR-100",
        "epochs": 10
    },
    
    mode="local",
)

# 模拟一次训练
epochs = 10
offset = random.random() / 5
for epoch in range(2, epochs):
  acc = 1 - 2 ** -epoch - random.random() / epoch - offset
  loss = 2 ** -epoch + random.random() / epoch + offset

  # 记录训练指标
  swanlab.log({"acc": acc, "loss": loss})

# [可选] 完成训练,这在notebook环境中是必要的
swanlab.finish()

将跑完后的swanlog/run-*文件夹,通过swanlab sync到云端,查看实验时发现:

  1. config缺失
  2. 日志缺失
  3. 环境信息缺失

link:https://swanlab.cn/@ZeyiLin/my-awesome-project/runs/vcwrvvyhn0v1clihc5wrr/chart

此时对日志文件进行swanlab watch

Image

Image

🚑 Any additional [like screenshots]

  • SwanLab Version: v0.6.3

  • Platform: MacOS

Metadata

Metadata

Assignees

Labels

🐛 bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions