-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Conversation
if edit "{save_dir}/last_checkpoint" by vim, "\n" will auto append to the end of file. which will raise ``` FileNotFoundError: [Errno 2] No such file or directory: 'save_dir/model_0060000.pth\n' ```
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Thanks for the PR!
I left a comment, let me know what you think.
@@ -79,6 +79,7 @@ def get_checkpoint_file(self): | |||
try: | |||
with open(save_file, "r") as f: | |||
last_saved = f.read() | |||
last_saved = last_saved.replace("\n", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about using .strip()
instead, would that be more robust (for example, on Windows)?
if edit "{save_dir}/last_checkpoint" by vim, "\n" will auto append to the end of file. which will raise ``` FileNotFoundError: [Errno 2] No such file or directory: 'save_dir/model_0060000.pth\n' ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
* Update checkpoint.py if edit "{save_dir}/last_checkpoint" by vim, "\n" will auto append to the end of file. which will raise ``` FileNotFoundError: [Errno 2] No such file or directory: 'save_dir/model_0060000.pth\n' ``` * Update checkpoint.py if edit "{save_dir}/last_checkpoint" by vim, "\n" will auto append to the end of file. which will raise ``` FileNotFoundError: [Errno 2] No such file or directory: 'save_dir/model_0060000.pth\n' ```
if edit "{save_dir}/last_checkpoint" by vim, "\n" will auto append to the end of file. which will raise