def vgg16_netvlad(pretrained=False):
base_model = models.create('vgg16', pretrained=False)
pool_layer = models.create('netvlad', dim=base_model.feature_dim)
model = models.create('embednetpca', base_model, pool_layer)
if pretrained:
model.load_state_dict(torch.hub.load_state_dict_from_url('https://github.com/yxgeee/OpenIBL/releases/download/v0.1.0-beta/vgg16_netvlad.pth', map_location=torch.device('cpu')))
return model
大大,我下载的网络是来自于SFRS: Self-supervising Fine-grained Region Similarities for Large-scale Image Localization (ECCV'20 Spotlight)开源;
将torch model转换为pytorch script的过程出现一些格式的错误,根据提示修改了以下代码:
接着生成pytorch_script文件
model = torch.hub.load('yxgeee/OpenIBL', 'vgg16_netvlad', pretrained=True).eval()
# Script the model
scripted_model = torch.jit.script(model)
# Save the scripted model to a file
scripted_model.save("scripted_vgg16netvlad.pt")
error log | 日志或报错信息 | ログ
model | 模型 | モデル
original model
how to reproduce | 复现步骤 | 再現方法
1.构建网络
大大,我下载的网络是来自于SFRS: Self-supervising Fine-grained Region Similarities for Large-scale Image Localization (ECCV'20 Spotlight)开源; 将torch model转换为pytorch script的过程出现一些格式的错误,根据提示修改了以下代码: 接着生成pytorch_script文件
@2、转pnnx时,出现上面的误差;请大佬帮我看看