Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: sync tensorboard(x) #796

Merged
merged 6 commits into from
Jan 20, 2025
Merged

feat: sync tensorboard(x) #796

merged 6 commits into from
Jan 20, 2025

Conversation

Zeyi-Lin
Copy link
Member

@Zeyi-Lin Zeyi-Lin commented Jan 20, 2025

Description

支持同步tensorboardX和pytorch自带的tensorboard。

交互:

from tensorboardX import SummaryWriter
# from torch.utils.tensorboard import SummaryWriter
import numpy as np
import swanlab

swanlab.sync_tensorboardX()
# swanlab.sync_tensorboard_torch()

writer = SummaryWriter('runs/example')

for i in range(100):
    scalar_value = np.random.rand()
    writer.add_scalar('random_scalar', scalar_value, i)

writer.close()

This pull request adds functionality for syncing TensorBoard logs with SwanLab. The most important changes include importing and defining new synchronization functions, updating the __init__.py files to include these new functions, and adding a test script for the new functionality.

New synchronization functions:

  • swanlab/sync/tensorboard.py: Added sync_tensorboardX and sync_tensorboard_torch functions to enable synchronization of TensorBoard logs with SwanLab.

Updates to initialization files:

Testing:

Closes: #786

@Zeyi-Lin Zeyi-Lin requested a review from SAKURA-CAT January 20, 2025 08:56
@Zeyi-Lin Zeyi-Lin self-assigned this Jan 20, 2025
@Zeyi-Lin Zeyi-Lin added the 💪 enhancement New feature or request label Jan 20, 2025
@SAKURA-CAT SAKURA-CAT merged commit 7f7d967 into main Jan 20, 2025
5 checks passed
@SAKURA-CAT SAKURA-CAT deleted the feat-sync-tensorboard(X) branch January 20, 2025 09:19
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] sync tensorbord
2 participants