Skip to content

BUG: --result_folder Deletion #30

@kodamaChameleon

Description

@kodamaChameleon

Description

The --result_folder deletes previous folder without warning.

if os.path.exists(opt.result_folder):
    shutil.rmtree(opt.result_folder)
os.makedirs(opt.result_folder)

So if you happen to want to save your results in the same folder as your checkpoint weights, you delete it instead. This is incredibly risky behavior.

Recommendation

Confirm deletion before doing so with:

if os.path.exists(opt.result_folder):
    print(f"About to delete: {opt.result_folder}")
    input("Press Enter to confirm...")
    shutil.rmtree(opt.result_folder)
os.makedirs(opt.result_folder)

OR, just don't delete the folder in the first place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions