quic / ai-hub-apps

The Qualcomm® AI Hub apps are a collection of state-of-the-art machine learning models optimized for performance (latency, memory etc.) and ready to deploy on Qualcomm® devices.
BSD 3-Clause "New" or "Revised" License
65 stars 14 forks source link

How can I depoly qai-hub-models on local device #9

Closed 1826133674 closed 1 week ago

1826133674 commented 3 weeks ago

Hello, I'm trying to deploy the models which released on qai-hub sites. But I can not make it.

When I use the demo code of SD v1-5, I found that output's shape of unet can not be reshaped to (1,64,64,4).

output_data = run_qnn_net_run(f'{target_device_dir}/unet.serialized.bin', [input_data_1, input_data_2, input_data_3],rh,device)

Output of UNet should be of shape (1, 64, 64, 4)

output_data = output_data.reshape((1, 64, 64, 4))

ValueError: cannot reshape array of size 59136 into shape (1,64,64,4)

To reproduce the error: use the models on https://aihub.qualcomm.com/mobile/models/stable_diffusion_v1_5_quantized?domain=Generative+AI&useCase=Image+Generation to replace the model generated by th following demo.

https://docs.qualcomm.com/bundle/publicresource/topics/80-64748-1/model_execution_android.html