Browse Source
Avoid auto download given local checkpoint path
Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
1 changed files with
1 additions and
1 deletions
-
timm_image.py
|
@ -58,7 +58,7 @@ class Model: |
|
|
self.device = device |
|
|
self.device = device |
|
|
if checkpoint_path: |
|
|
if checkpoint_path: |
|
|
assert os.path.exists(checkpoint_path), f'File not found: {checkpoint_path}' |
|
|
assert os.path.exists(checkpoint_path), f'File not found: {checkpoint_path}' |
|
|
self.model = create_model(model_name, checkpoint_path, num_classes=num_classes) |
|
|
|
|
|
|
|
|
self.model = create_model(model_name, pretrained=False, checkpoint_path=checkpoint_path, num_classes=num_classes) |
|
|
else: |
|
|
else: |
|
|
self.model = create_model(model_name, pretrained=True, num_classes=num_classes) |
|
|
self.model = create_model(model_name, pretrained=True, num_classes=num_classes) |
|
|
self.model.eval() |
|
|
self.model.eval() |
|
|