-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
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
[Bug]: Error: Unexpected type of example_input #21899
Comments
@kolabearafk What exactly you provide as |
Hi @mvafin, Thanks for the reply! I'm trying to put a dictionary inside the example_input dictionary. Please see below for more information:
I was able to get it working after following @eaidova's advice by trying with openvino-nightly instead of openvino 2023.2.0. It was able to convert the unet with openvino-nightly. But I am ran into a different error when compiling the model when it says "CPU Plugin: Input image format dynamic is not supported yet..." Please see attached screenshot for the error message. ![]() |
@kolabearafk This happens because some of model inputs have unspecified (dynamic) data type. To solve this problem you need to specify data type of the input using something like this:
|
That doesn't seem to work for some reason and gives the same "CPU Plugin: Input image format dynamic is not supported yet..." error. |
Could you do |
Closing due to no activity |
OpenVINO Version
openvino 2023.2.0
Operating System
Ubuntu 20.04 (LTS)
Device used for inference
CPU
Framework
PyTorch
Model used
StableDiffusion UNet - https://github.com/huggingface/diffusers/blob/645a62bf3bcba47f97bf2a36a8689f40bd6b04fd/src/diffusers/models/unet_2d_condition.py#L843
Issue description
Describe the bug
Can't use dictionary type for example_input when trying to convert pytorch model
Expected behavior
Not giving this - "Error: Unexpected type of example_input" and successfully convert the pytorch model to openvino
Screenshots
Additional context
I'm trying to convert the UNet model from diffusers library's StableDiffusionPipeline but with an additional parameter called "added_cond_kwargs" that is supposed to be Dict[str, torch.Tensor]. But openvino's ov.convert_model(unet, example_input) function is giving the error "Error: Unexpected type of example_input".
It seems openvino's pytorch_frontend_utils.py script raises an error if the type of example_input doesn't match the expected type (see
openvino/tools/mo/openvino/tools/mo/moc_frontend/pytorch_frontend_utils.py
Line 158 in 9dad09a
Please help! Thank you.
Step-by-step reproduction
No response
Relevant log output
Issue submission checklist
The text was updated successfully, but these errors were encountered: