Spaces:
Runtime error
Runtime error
fixed path
Browse filesFiles changed (3)
13 unmodified lines141516171718192013 unmodified linesdef colorize_image(image): # Load the model # file_path = 'ImageColorizationModel10.pth' file_path = r'model\model_final.pth' file_path = './model/model_final.pth' model_2 = inf.load_model(model_class=MainModel, file_path=file_path) output_img = inf.predict_color(model_2, image=image) return output_img97 unmodified lines989910010110110210310497 unmodified lines model.load_state_dict(torch.load(file_path, map_location=device))
resnet_weights = torch.load(file_path) resnet_weights = torch.load(r"model\res18-unet.pt") resnet_weights = torch.load("./model/res18-unet.pt") resnet_state_dict = resnet_weights['state_dict'] if 'state_dict' in resnet_weights else resnet_weights
model_dict = model.state_dict()__pycache__/inference.cpython-312.pyc
app.py+1-1
inference.py+1-1