Open Dorismz opened 6 years ago
please somebody tell me where can i get the images.txt ? Thanks a lot! and , i can't make successful, it was error: undefined reference to symbol 'pthread_create@@GLIBC2.2.5. so, how can i get the lib,"pthread,"?
怎样把这个pth转成onnx?
---------求带。。。。 我转换的时候出现提示“copying a param with shape torch.Size([512,4608]) from checkpoint, the shape in current model is torch.Size([512,4620800]).” ---------下面是我的转换代码----------: import torch, onnx, collections from torchvision.models.utils import load_state_dict_from_url from siamese import Siamese from PIL import Image import numpy as np print('notice !!!! ----> use python3 run this script!!! \n') INPUT_DICT = 'model_data/Omniglot_vgg.pth'#input path OUT_ONNX = 'E:/data/att_faces/Siamese-pytorch-master/Siamese-pytorch-master/model_data/Omniglot_vgg.onnx'#output path device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') model = Siamese() model.load_state_dict(torch.load(self.model_path, map_location=device)) model.eval() x = torch.randn(1, 3, 105, 105); input_names = ["input"]; out_names = ["output"];
torch.onnx.export(model, x, OUT_ONNX, export_params=True, training=False, input_names=input_names, output_names=out_names)
print('convert done!\n')
please somebody tell me where can i get the images.txt ? Thanks a lot!