princeton-vl / CornerNet

BSD 3-Clause "New" or "Revised" License
2.36k stars 475 forks source link

How to convert. Pkl weight file to torch script format #176

Open zzz2222 opened 3 years ago

zzz2222 commented 3 years ago

I tried to convert, but found that in network instantiation, the parameter of the network is object instead of object nn.module , net = NetworkFactory(flag=True) net.load_state_dict(torch.load(r"E:\cache\nnet\LSTR\LSTR_100.pkl"), False) which results in an error: AttributeError: 'NetworkFactory' object has no attribute 'load_state_dict' . How can I solve this problem