apple / apple/coremltools

cant convert multiple inputs model to be flexible

Open
#1,750 3 comments 0 reactions 0 assignees View on GitHub
PyTorch (traced) question
Dominant language
Python
Stars
5.4k
Forks
850
Avg merge
4d 5h
Merged PRs (30d)
10

Description

## multiple inputs to be flexible error

- when convert multiple inputs to be flexible, some error comes
'NotImplementedError: Image output 'output_img' has symbolic dimensions in its shape'
- is there any sample of multi input model to be flexible, here is my code
```
input1_shape = ct.Shape(shape=(1,
256,
ct.RangeDim(lower_bound=16, upper_bound=136, default=52),
ct.RangeDim(lower_bound=16, upper_bound=240, default=120)))
input1_shape = ct.Shape(shape=(1,
128,
ct.RangeDim(lower_bound=4, upper_bound=34, default=17),
ct.RangeDim(lower_bound=4, upper_bound=60, default=30)))
input_1=ct.TensorType(name="input_1", shape=input_1_shape)
input_2=ct.TensorType(name="input_2", shape=input_2_shape)
outputs=ct.ImageType(name="output_img",color_layout=ct.colorlayout.RGB)
mlmodel = ct.convert(
trace_model,
inputs=[input_1, input_2],
outputs=[outputs],
)
```

Contributor guide

Open the contributing guide

Research direction

Start with the ct.convert call in the issue, focusing on the two flexible TensorType inputs and the ImageType output that raises the symbolic-dimensions NotImplementedError. Reproduce the conversion with the supplied shapes, then inspect the converter path handling multiple flexible inputs and image outputs; done means the behavior is fixed or a documented limitation and working multi-input example are provided.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.