naver / dust3r

DUSt3R: Geometric 3D Vision Made Easy
https://dust3r.europe.naverlabs.com/
Other
4.66k stars 517 forks source link

Unexpected `force` option for `print()` #24

Closed nautics889 closed 4 months ago

nautics889 commented 4 months ago

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
yocabon commented 4 months ago

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 commented 4 months ago

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