(path, scripts_to_save=None)
| 30 | |
| 31 | |
| 32 | def create_exp_dir(path, scripts_to_save=None): |
| 33 | if not os.path.exists(path): |
| 34 | os.mkdir(path) |
| 35 | |
| 36 | print('Experiment dir : {}'.format(path)) |
| 37 | if scripts_to_save is not None: |
| 38 | os.mkdir(os.path.join(path, 'scripts')) |
| 39 | for script in scripts_to_save: |
| 40 | dst_file = os.path.join(path, 'scripts', os.path.basename(script)) |
| 41 | shutil.copyfile(script, dst_file) |
| 42 | |
| 43 | |
| 44 | def save_checkpoint(model, optimizer, epoch, path, finetune=False): |
no outgoing calls
no test coverage detected