You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get an exciting idea, i try to save freeze_model to disk, then use torch.jit.load get freeze_model before convert coreml, this problem not happened! like this:
importtorchimportcoremltoolsasct# init maxpool moduletorch_model=torch.nn.Conv2d(3, 3, 1, 1)
# Trace with random dataexample_input=torch.rand(1, 3, 224, 224)
trace_model=torch.jit.trace(torch_model, example_input).eval()
freeze_model=torch.jit.freeze(trace_model)
# save freeze model to diskfreeze_model.save("tmp.trace.pt")
# get freeze_model from diskfreeze_model=torch.jit.load("tmp.trace.pt")
# Convert to Core ML using the Unified Conversion APImodel=ct.convert(
freeze_model,
inputs=[ct.ImageType(name="input", shape=example_input.shape)],
)
🐞Describe the bug
I got this error when convert coremlmodel after torch.jit.freeze
Trace
To Reproduce
System environment (please complete the following information):
The text was updated successfully, but these errors were encountered: