-
Notifications
You must be signed in to change notification settings - Fork 384
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
How to use tensordboard? #195
Comments
Add this in the training code from torch.utils.tensorboard import SummaryWriter
tboard_writer = SummaryWriter(log_dir="experiments")
# to add the network structure in the tensorboard logger
# make sure the type matches the input type required for the model
_dummy_input = torch.ones([1, c, h, w], dtype=torch.float32).to(self.device)
tboard_writer.add_graph(self.model, _dummy_input)
# to add a batch of images in the tensorboard logger
tboard_writer.add_images('preprocessed image batch',
next(iter(train_data_loader))[0],
epoch_number)
# to add scalars such as loss/accuracy values in the tensorboard logger
tboard_writer.add_scalars('Loss (epoch)',
{'train': train_loss},
epoch_number) Install tensorboard using pip, i.e. $ tensorboard --logdir=experiments --port=6006 More instructions here at the official PyTorch documentation |
hello,i met this problem could you help me? |
Check the |
Thank you the code is work. But I still don't know in |
This line Then from a different terminal, you can enter |
I want to look at the network structure diagram, but I am not sure how to change it,and i don't know how to use tensorboard, can you help me?
The text was updated successfully, but these errors were encountered: