question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: type object got multiple values for keyword argument 'logdir'

See original GitHub issue

from ignite.contrib.handlers.tensorboard_logger import TensorboardLogger tb = TensorboardLogger(log_dir=None)

gives the following error:

self.file_writer = FileWriter(logdir=log_dir, **kwargs)

TypeError: type object got multiple values for keyword argument ‘logdir’

This also happens when I run

from tensorboardX import SummaryWriter sw = SummaryWriter(log_dir=None)

self.file_writer = FileWriter(logdir=log_dir, **kwargs)

TypeError: type object got multiple values for keyword argument ‘logdir’

However, when I do don’t put in logdir=log_dir, and simply pass in log_dir, it works fine.

I was looking to see if there’s any conflicting reference with self or anything like that, but it doesn’t seem like that’s the problem, since all the self’s seem to be in place, so I’m not sure.

Any ideas?

ignite version: 1.1.0 tensorboard version: 1.13.1 tensorboardX version: 1.6

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

8reactions
tonyhqanguyencommented, May 27, 2019

I think the problem is in self.writer = SummaryWriter(logdir=log_dir) in tensorboard_logger.py (line 408 in the class TensorboardLogger). logdir should be log_dir(since the class SummaryWriter has parameter log_dir, not logdir).

2reactions
vfdev-5commented, May 27, 2019

I think we need handle both version for instance until 0.3.0. So we need to intercept the exception

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/conda/envs/test/lib/python3.6/site-packages/ignite/contrib/handlers/tensorboard_logger.py", line 408, in __init__
    self.writer = SummaryWriter(logdir=log_dir)
  File "/opt/conda/envs/test/lib/python3.6/site-packages/tensorboardX/writer.py", line 279, in __init__
    self.file_writer = FileWriter(logdir=log_dir, **kwargs)
TypeError: type object got multiple values for keyword argument 'logdir'

and raise a warning saying to update to tensorboardX==1.7 and setup self.writer with another argument.

cc @anmolsjoshi

Read more comments on GitHub >

github_iconTop Results From Across the Web

got multiple values for keyword argument - python
The problem is that the first argument passed to class methods in python is ... "TypeError: foodo() got multiple values for keyword argument...
Read more >
TypeError: got multiple values for argument in Python
The Python TypeError: got multiple values for argument occurs when we overwrite the value of a positional argument with a keyword argument ......
Read more >
type object got multiple values for keyword argument 'logdir'_ ...
1. TypeError: type object got multiple values for keyword argument 'logdir'. 在这里插入图片描述 解决方案:.
Read more >
Custom model field/form: __init__() got multiple values for ...
Hello, The problematic code can be found here: <https://gist.github.com/1229708> TypeError: __init__() got multiple values for keyword argument 'baz'
Read more >
Got Multiple Values For Keyword Argument 'X' - ADocLib
TypeError : type object got multiple values for keyword argument 'logdir' #538. Closed. UltraSpecialException opened this issue on May 27.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found