adjust sweep file to new config structure
This commit is contained in:
1 parent
801dc8ec96
commit
166bd57198
5 files changed
+48
-25
No files matched your search
@@ -13,11 +13,11 @@ def predict():
|
||||
CKPT_PATH = "epoch=0.ckpt"
|
||||
|
||||
# load model from checkpoint
|
||||
pretrained_model = LitModel.load_from_checkpoint(checkpoint_path=CKPT_PATH)
|
||||
trained_model = LitModel.load_from_checkpoint(checkpoint_path=CKPT_PATH)
|
||||
|
||||
# switch to evaluation mode
|
||||
pretrained_model.eval()
|
||||
pretrained_model.freeze()
|
||||
trained_model.eval()
|
||||
trained_model.freeze()
|
||||
|
||||
# load data
|
||||
img = Image.open("../../example_img.png").convert("RGB")
|
||||
@@ -27,7 +27,7 @@ def predict():
|
||||
img = img.reshape((1, *img.size())) # reshape to form batch of size 1
|
||||
|
||||
# inference
|
||||
output = pretrained_model(img)
|
||||
output = trained_model(img)
|
||||
print(output)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user