Skip to content

Commit

Permalink
Fix os.path to Path
Browse files Browse the repository at this point in the history
  • Loading branch information
harimkang committed Jun 24, 2024
1 parent e25bdcf commit af14fab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/otx/algo/classification/backbones/efficientnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import math
import os
from pathlib import Path

import torch
import torch.nn.functional as F
Expand Down Expand Up @@ -661,6 +662,6 @@ def init_weights(self, pretrained: bool | str | None = None):
load_checkpoint_to_model(self, checkpoint)
print(f"init weight - {pretrained}")
elif pretrained is not None:
cache_dir = os.path.join("~", ".cache", "torch", "hub", "checkpoints")
download_model(net=self, model_name=self.model_name, local_model_store_dir_path=cache_dir)
cache_dir = Path.home() / ".cache" / "torch" / "hub" / "checkpoints"
download_model(net=self, model_name=self.model_name, local_model_store_dir_path=str(cache_dir))
print(f"init weight - {pretrained_urls[self.model_name]}")

0 comments on commit af14fab

Please sign in to comment.