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 tried to convert onnx model with dynamic batch size into deepsparse
from deepsparse import compile_model
from deepsparse.utils import generate_random_inputs
onnx_filepath = "tts_model.onnx"
batch_size = 4
# Generate random sample input
inputs = generate_random_inputs(onnx_filepath, batch_size)
# Compile and run
engine = compile_model(onnx_filepath, batch_size)
print(engine)
outputs = engine.run(inputs)
I have error:
[nm_ort 7f4a13f2b280 >WARN< is_supported_graph src/onnxruntime_neuralmagic/supported/ops.cc:199] Warning: Optimized runtime disabled - Detected dynamic input input dim 1. Set inputs to static shapes to enable optimal performance.
deepsparse.engine.Engine:
onnx_file_path: tts_model.onnx
batch_size: 4
num_cores: 10
num_streams: 1
scheduler: Scheduler.default
fraction_of_supported_ops: 0.0
cpu_avx_type: avx2
cpu_vnni: False
2024-05-06 17:31:54.756632238 [E:onnxruntime:, sequential_executor.cc:521 ExecuteKernel] Non-zero status code returned while running Gather node. Name:'Gather_token_15' Status Message: indices element out of data bounds, idx=2 must be within the inclusive range [-2,1]
Traceback (most recent call last):
File "/home/tupk/tupk/nlp/custom/deploy_tts/deepsparse_to_onnx.py", line 12, in <module>
outputs = engine.run(inputs)
File "/home/tupk/anaconda3/envs/dl/lib/python3.10/site-packages/deepsparse/engine.py", line 532, in run
return self._eng_net.execute_list_out(inp)
RuntimeError: NM: error: Non-zero status code returned while running Gather node. Name:'Gather_token_15' Status Message: indices element out of data bounds, idx=2 must be within the inclusive range [-2,1]
How can I use deepsparse?
Thank you very much!
The text was updated successfully, but these errors were encountered:
Hey @phamkhactu from the error message "indices element out of data bounds, idx=2 must be within the inclusive range [-2,1]" it seems that the model is sensitive to the input data provided since it uses that as an index for a Gather operation. Could you try manually making an input of all zeros and passing that in? You could also precisely set the input shapes using the input_shapes= parameter
I tried to convert onnx model with dynamic batch size into deepsparse
I have error:
How can I use deepsparse?
Thank you very much!
The text was updated successfully, but these errors were encountered: