Skip to content

Commit

Permalink
expand user
Browse files Browse the repository at this point in the history
  • Loading branch information
michalwols committed Jan 11, 2024
1 parent 27a5f35 commit e831fca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions yann/config/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@


class default:
root = Path('~/.yann/')
torch_root = Path('~/.torch')
root = Path('~/.yann/').expanduser()
torch_root = Path('~/.torch').expanduser()
train_root = './runs/'
datasets_root = torch_root / 'datasets'

Expand Down
5 changes: 3 additions & 2 deletions yann/datasets/food101.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,18 @@ def __init__(
self,
root=None,
split='train',
download=True,
download=False,
shuffle=True
):
assert split in self.splits
self.root = Path(root) if root else yann.default.dataset_root(Food101)
self.root = self.root.expanduser()
self.split = split

if not self.root.exists() and download:
self.download()

with open(self.meta_path) as f:
with open(self.meta_path, 'r') as f:
self.samples = [
(self.get_image_path(name.strip()), name.split('/')[0])
for name in f
Expand Down
2 changes: 1 addition & 1 deletion yann/train/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ def __init__(
self.update_summary()
self.save_summary()

self.callbacks.on_init(trainer=self, kwargs=kwargs)
# self.callbacks.on_init(trainer=self, kwargs=kwargs)

def _init_callbacks(
self,
Expand Down

0 comments on commit e831fca

Please sign in to comment.