-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关于从本地加载brisque_svm_weights.pth文件的问题 #193
Comments
|
谢谢您的回复! 另外,第一次调用score_nr = self.model_BRISQUE(img_path_src)时,需要的时间非常长,差不多要一分多钟,执行后面图像的分析就快很多 了,这是正常吗? 是否有提高速度的方法? |
警告信息不影响实际使用。 初次加载的速度问题可能是受到 load 权重的影响,后续尝试解决 |
您好! 我事先把brisque_svm_weights.pth文件下载到本地,然后想初始化时从本地加载brisque_svm_weights.pth,基本代码逻辑如下:
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
model_BRISQUE = pyiqa.create_metric('brisque', device=device)
pretrained_model_path = “D:\work\VideoAI\VAS\VQCV\weights\brisque_svm_weights.pth”
weights = torch.load(pretrained_model_path, map_location=device, weights_only=True)
model_BRISQUE.load_state_dict(weights)
执行代码“model_BRISQUE.load_state_dict(weights)”时会异常,提示weights不是一个dict类型。
请问如何才能正确加载brisque_svm_weights.pth? 谢谢。
The text was updated successfully, but these errors were encountered: