We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
我转onnx的代码如下: onnx版本是1.6.0
import torch import os import numpy as np from model.mobilenext import mnext
def main(): initial_checkpoint = 'mobiilenext_se.pth' network = mnext(num_classes=2) network.eval() state = torch.load(initial_checkpoint, map_location=lambda storage, loc: storage) network.load_state_dict({k[7:]: v for k, v in state.items()}) dummy_input1 = torch.randn(1, 3, 48, 48) input_names = ["input"] output_names = ["output"] torch.onnx.export(network, dummy_input1, "mobilenext_se.onnx", verbose=True, input_names=input_names, output_names=output_names)
if name == 'main': main()
The text was updated successfully, but these errors were encountered:
你好, 我之前没有尝试过转onnx,但是我们转过caffee 结果是可以的。
Sorry, something went wrong.
@zhoudaquan 请问转caffe的时候 if self.identity: shape = x.shape id_tensor = x[:,:shape[1]//self.identity_div,:,:] # id_tensor = torch.cat([x[:,:shape[1]//self.identity_div,:,:],torch.zeros(shape)[:,shape[1]//self.identity_div:,:,:].cuda()],dim=1) # import pdb; pdb.set_trace() out[:,:shape[1]//self.identity_div,:,:] = out[:,:shape[1]//self.identity_div,:,:] + id_tensor 这个操作支持吗?我是先转的onnx后转的caffe,onnx里会有slice和scatterND操作caffe不支持
No branches or pull requests
我转onnx的代码如下:
onnx版本是1.6.0
import torch
import os
import numpy as np
from model.mobilenext import mnext
def main():
initial_checkpoint = 'mobiilenext_se.pth'
network = mnext(num_classes=2)
network.eval()
state = torch.load(initial_checkpoint, map_location=lambda storage, loc: storage)
network.load_state_dict({k[7:]: v for k, v in state.items()})
dummy_input1 = torch.randn(1, 3, 48, 48)
input_names = ["input"]
output_names = ["output"]
torch.onnx.export(network, dummy_input1, "mobilenext_se.onnx", verbose=True, input_names=input_names,
output_names=output_names)
if name == 'main':
main()
The text was updated successfully, but these errors were encountered: