Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Onnx to mlmodel conversion fails to generate .mlmodel file #564

Open
@ghost

Description

I'm trying to convert Pytorch model to MLModel with Onnx.

My code:

import torch
from onnx_coreml import convert
import coremltools

net = BiSeNet(19)
net.cuda()
net.load_state_dict(torch.load('model.pth'))
#net.eval()

dummy = torch.rand(1,3,512,512).cuda()


torch.onnx.export(net, dummy, "Model.onnx", input_names=["image"], output_names=["output"], opset_version=11)

finalModel = convert(model='Model.onnx', minimum_ios_deployment_target='12')
finalModel.save('ModelML.mlmodel')

After the code runs Model.onnx is generated, however, .mlmodel file is not generated. There're no errors in the console.

What could be the issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting responsePlease respond to this issue to provide further clarification (status)questionResponse providing clarification needed. Will not be assigned to a release. (type)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions