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: __init__() got an unexpected keyword argument 'log_dir'

See original GitHub issue

Machine: Amazon EC2 Deep Learning AMI (pytorch_p36 environment)

I have a training script that is trying to create a TensorboardLogger, but that is failing with the below stacktrace. I have pip installed the latest version of ignite.

  File "train.py", line 336, in train
    tb_logger = TensorboardLogger(log_dir=None)
  File "/home/ec2-user/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/ignite/contrib/handlers/tensorboard_logger.py", line 355, in __init__
    self.writer = SummaryWriter(log_dir=log_dir)
  File "/home/ec2-user/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/tensorboardX/writer.py", line 254, in __init__
    self._get_file_writer()
  File "/home/ec2-user/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/tensorboardX/writer.py", line 310, in _get_file_writer
    self.file_writer = FileWriter(logdir=self.logdir, **self.kwargs)
TypeError: __init__() got an unexpected keyword argument 'log_dir'

Could you please explain why this is happening and what I can do to fix it? Thanks!

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
tonyhqanguyencommented, May 27, 2019

I did that, but still am encountering the problem. I reverted my tensorboardX to 1.6, I think it’s fixing the problem.

2reactions
vfdev-5commented, May 27, 2019

@UltraSpecialException I think the code you are trying to use: https://github.com/huggingface/transfer-learning-conv-ai/blob/b7f295f840f719056287504554083ec3f2688651/train.py#L234 is working with tensorboardX < 1.7 since tensorboardx master SummaryWriter has attribute logdir instead of log_dirhttps://github.com/lanpa/tensorboardX/blob/3e35c9b5f85e8ceb0294532d9eb772341a04c097/tensorboardX/writer.py#L244

Btw, yes, ignite is compatible with python 2.7 and 3.x

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: __init__() got an unexpected keyword argument ...
I encounter the issue,as follows: '''TypeError: init() got an unexpected keyword argument 'logdir'''' How can I solve this issue? tensorflow ...
Read more >
TypeError: __init__() got an unexpected keyword argument ...
I am trying to build model to convert Sign Language to text. I am facing some problem while trying to create and using...
Read more >
init() got an unexpected keyword argument 'log_dir'_农夫山泉 ...
pytorch报错TypeError: init() got an unexpected keyword argument 'log_dir' ... SummaryWriter(logdir=log_dir) self.writer = tensorboardX.
Read more >
After updating from Ray 1.0.1 to 1.2, custom model stops ...
TypeError : __init__() got an unexpected keyword argument 'drop_rate' ... Module): def __init__(self, obs_space, action_space, num_outputs, ...
Read more >
tensorflow/skflow - Gitter
StreamDataFeeder does and without this DaskDataFeeder does not have ... in outputs: TypeError: evaluate() got an unexpected keyword argument 'batch_size'.
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