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.

BUG? _log() got an unexpected keyword argument 'end'

See original GitHub issue
Traceback (most recent call last):                                                      | 0/949 [00:00<?, ?it/s]
  File "train_bert.py", line 105, in <module>
    main()
  File "train_bert.py", line 95, in main
    model.train_model(train_df=df_train)
  File "/opt/conda/lib/python3.6/site-packages/simpletransformers/classification/classification_model.py", line 219, in train_model
    global_step, tr_loss = self.train(train_dataset, output_dir, multi_label=multi_label, show_running_loss=show_running_loss, eval_df=eval_df, **kwargs)
  File "/opt/conda/lib/python3.6/site-packages/simpletransformers/classification/classification_model.py", line 330, in train
    logger.info("\rRunning loss: %f\n" % loss, end="")
  File "/opt/conda/lib/python3.6/logging/__init__.py", line 1307, in info
    self._log(INFO, msg, args, **kwargs)
TypeError: _log() got an unexpected keyword argument 'end'

Looks like switching from print to logging is causing this issue

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
todd-cookcommented, Jan 29, 2020

@ThilinaRajapakse let me know if you want me to take a stab at this.

1reaction
todd-cookcommented, Jan 29, 2020

Can we please follow best practices? see: https://docs.python.org/3/howto/logging.html#library-config

logging.info()… is bad form, not recommended, should actually declare a Logger instance. Also the error is: logger.info(“\rRunning loss: %f\n” % loss, end=“”)

@kinoute This is a library, if folks want info from it, they should initialize a logger: import logging logging.basicConfig(level=logging.DEBUG)

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: _log() got an unexpected keyword argument ...
Using stacklevel with log.error produces this error ...
Read more >
Error in prod - TypeError: _log() got an unexpected keyword ...
Successfully merging a pull request may close this issue. Get rid of invalid argument file when logging codalab/codalab-worksheets.
Read more >
Bug #143748 (zope2dev-2155) “_log() got an unexpected ...
I'm not sure I understand the original problem, exactly, but I encountered "_log() got an unexpected keyword argument 'error'" when starting up ...
Read more >
2033970 – Repository sync ends with a warning of "Artifact ...
Bug 2033970 - Repository sync ends with a warning of "Artifact() got an unexpected keyword argument 'sha'" for some repos in Satellite 6.10....
Read more >
logging module: log method with keyword arguments
_log, (DEBUG, msg, args), kwargs) TypeError: _log() got an unexpected keyword argument 'msg2' Now, I can kind of understand this because the ...
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