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

AttributeError: 'NoneType' object has no attribute 'get_logdir' #676

Open
ranshuo-ICer opened this issue Nov 1, 2022 · 3 comments
Open

Comments

@ranshuo-ICer
Copy link

Describe the bug
When I was using tensorboardX in pytorch to record hyper parameters, I got the error as the title described.

Minimal runnable code to reproduce the behavior

import tensorboardX
writer = tensorboardX.SummaryWriter()
hparams = {'batch_size': args.batch_size,
           'lr': args.lr,
           'momentum': args.momentum,
           'weight_decay': args.weight_decay}
writer.add_hparams(hparams, {'best_acc1': best_acc1})
...

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

Environment
What is the result of

protobuf 3.19.6
tensorboard 2.10.1
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.8.1
tensorboardX 2.2
torch 1.11.0
torch-tb-profiler 0.4.0
torchaudio 0.11.0
torchvision 0.12.0

Python environment
Which version of python are you using? Did you use Andconda or Virtualenv?
Andconda
Additional context
Add any other context about the problem here.

@lanpa
Copy link
Owner

lanpa commented Nov 6, 2022

Hi, I can't reproduce with tensorboardX 2.2.
image

Do you have more information?

@ranshuo-ICer
Copy link
Author

OK, I found the question. i called writer.close() every epochs to refresh the output file. Changing the code like this, i reproduce the bug:
image

@lanpa
Copy link
Owner

lanpa commented Dec 11, 2022

Hi, because the writer was closed and followed by another write operation. We should have a warning for this. Thanks for pointing out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants