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

Unexpected force option for print() #24

Closed
nautics889 opened this issue Mar 5, 2024 · 2 comments
Closed

Unexpected force option for print() #24

nautics889 opened this issue Mar 5, 2024 · 2 comments

Comments

@nautics889
Copy link

There's calling print() with passing force=True (at losses.py, L222).
However, built-in print() function can't accept this parameter:

>>> print("something", force=True)
Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm 2022.3.2\plugins\python\helpers\pydev\pydevconsole.py", line 364, in runcode
    coro = func()
           ^^^^^^
  File "<input>", line 1, in <module>
TypeError: 'force' is an invalid keyword argument for print()

I believe the author implied that parameter to flush stdout stream, so there should have been flush=True:

>>> print("something", flush=True)
something
nautics889 added a commit to nautics889/dust3r that referenced this issue Mar 5, 2024
* (fix): use 'flush=True' instead of 'force=True' when calling 'print()'
  functions in losses.py
@yocabon
Copy link
Contributor

yocabon commented Mar 5, 2024

Hi, during training, the built-in print method gets replaced with the one from https://github.com/naver/croco/blob/743ee71a2a9bf57cea6832a9064a70a0597fcfcb/utils/misc.py#L182

@nautics889
Copy link
Author

@yocabon ahh, thank you.
Sorry, I haven't seen your reply and uploaded the PR. Will close it now.

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

Successfully merging a pull request may close this issue.

2 participants