prevent preload warning message

This commit is contained in:
Lincoln Stein 2022-10-18 17:09:17 -04:00
parent 0147dd6431
commit a488b14373

View File

@ -120,7 +120,12 @@ try:
from models.clipseg import CLIPDensePredT
model = CLIPDensePredT(version='ViT-B/16', reduce_dim=64, )
model.eval()
model.load_state_dict(torch.load('src/clipseg/weights/rd64-uni-refined.pth'), strict=False)
model.load_state_dict(
torch.load('src/clipseg/weights/rd64-uni-refined.pth'),
model.load_state_dict(torch.load('src/clipseg/weights/rd64-uni-refined.pth'),
map_location=torch.device('cpu'),
strict=False,
)
except Exception:
print('Error installing clipseg model:')
print(traceback.format_exc())