Efficient-3DCNNs icon indicating copy to clipboard operation
Efficient-3DCNNs copied to clipboard

onnx export problem

Open Nioolek opened this issue 4 years ago • 2 comments

I tried to convert the 3DCNN model to onnx,but the inference results by onnx and pytorch are different.I tried the backbone of resnet18 and mobilenet.Did anybody meet the same problem?

Environment: CUDA 10.0 CUDNN 7 TENSORRT 7 PYTORCH 1.2.0

CODE:

model, parameters = generate_model(opt)
checkpoint = torch.load('my_mobilenet_1.0x_RGB_10_checkpoint.pth')

model.load_state_dict(checkpoint['state_dict'])
print('load checkpoint')
if isinstance(model, torch.nn.DataParallel):
    model = model.module

x = torch.ones((1, 3, 10, 128, 128)).cuda()

y = model(x)
print(y)

torch.onnx.export(model, x, '3dcnn.onnx', verbose=True)

Nioolek avatar Apr 03 '20 11:04 Nioolek

I never tried to cenvert these models to onnx, but in principle it should be possible. When I have time, I would try and let you know.

okankop avatar Apr 07 '20 09:04 okankop

@okankop After two years, still didn't try on exporting to onnx ? I saw several questions about low accuracy of pretrained models, didn't do any update?

poincarelee avatar Jul 13 '22 07:07 poincarelee