Pre-trained Model Not Loading

21 Views Asked by At

i have a codeformer pre-trained model from sczhou and i am trying to use that pre-trained model in my project, iam trying to use it since 20 days but i got module import error evrytime i don't know how can i fix this if anyone know about pytorch nad pre-tyrained model and how to load in api. anyone's response must appriceated.

import sys
sys.path.append('*')
import torch


from basicsr.models.codeformer_model import CodeFormerModel
# Instantiate CodeFormerModel
model = CodeFormerModel(__name__)


# Load the pretrained model weights
model_path = '*'
model.load_state_dict(torch.load(model_path, map_location=torch.device('cpu')))

# Set the model to evaluation mode
model.eval()

i am expecting that i can use this pre-trained model in. my project through api but i can not found any way to use it in api or developing an api using codeformer pre-trained model your text

0

There are 0 best solutions below