pytorch报错TypeError: init() got an unexpected keyword argument ‘log_dir’

转载自:https://blog.csdn.net/yangwangnndd/article/details/95112253

  • 问题描述:
    TypeError: init() got an unexpected keyword argument ‘log_dir’

  • 解决方案:
    v1.6 (log_dir): https://tensorboardx.readthedocs.io/en/v1.6/tensorboard.html#tensorboardX.SummaryWriter.init
    v1.7 (logdir): https://tensorboardx.readthedocs.io/en/latest/tensorboard.html#tensorboardX.SummaryWriter.init

  • tensorboardX接口参数改变导致的。用将log_dir改为logdir

# self.writer = tensorboardX.SummaryWriter(logdir=log_dir)
self.writer = tensorboardX.SummaryWriter(logdir=logdir)

你可能感兴趣的:(pytorch)