Skip to content

Commit

Permalink
Fix save_dir in the tune function (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyLianLong committed Jan 8, 2023
1 parent 66bfbc0 commit 1a10fda
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion torchsparse/utils/tune.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def tune(
collect_fn: Callable = lambda data: data,
enable_fp16: bool = False,
kmap_mode: str = 'hashmap',
save_dir: str = '~/.torchsparse',
save_dir: str = None,
tune_id: str = 'temp',
):
"""Search for the best group strategy by the provided model and data loader.
Expand Down Expand Up @@ -139,6 +139,8 @@ def dump(module, inputs, outputs, name):
})

group_configs = {}
if save_dir is None:
save_dir = os.path.expanduser('~/.torchsparse')
if os.path.exists(os.path.join(save_dir, tune_id)):
print('Load existing tuned group configs')
group_configs = torch.load(os.path.join(save_dir, tune_id))
Expand Down

0 comments on commit 1a10fda

Please sign in to comment.