using https://github.com/huggingface/optimum convert speechbrain to onnx
- User
using https://github.com/huggingface/optimum convert speechbrain to onnx
- Assistant
- User
why all speechbrain models have .cpkt files instead of .bin ?
- Assistant
- User
AttributeError Traceback (most recent call last) Cell In[5], line 2 1 # Export to ONNX ----> 2 torch.onnx.export(classifier.model, dummy_input, "speechbrain_model.onnx", input_names=["input"], output_names=["output"])
File ~/anaconda3/lib/python3.11/site-packages/torch/nn/modules/module.py:1709, in Module.getattr(self, name) 1707 if name in modules: 1708 return modules[name] -> 1709 raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")
AttributeError: 'Speech_Emotion_Diarization' object has no attribute 'model'
- Assistant
- User
i need Speech_Emotion_Diarization from speechbrain so use Speech_Emotion_Diarization in your response
- Assistant
- User
['HPARAMS_NEEDED', 'MODULES_NEEDED', 'T_destination', 'annotations', 'call', 'class', 'delattr', 'dict', 'dir', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '_apply', '_backward_hooks', '_backward_pre_hooks', '_buffers', '_call_impl', '_compile', '_compile_jit', '_compiled_call_impl', '_forward_hooks', '_forward_hooks_always_called', '_forward_hooks_with_kwargs', '_forward_pre_hooks', '_forward_pre_hooks_with_kwargs', '_get_backward_hooks', '_get_backward_pre_hooks', '_get_name', '_is_full_backward_hook', '_load_from_state_dict', '_load_state_dict_post_hooks', '_load_state_dict_pre_hooks', '_maybe_warn_non_full_backward_hook', '_modules', '_named_members', '_non_persistent_buffers_set', '_parameters', '_prepare_modules', '_register_load_state_dict_pre_hook', '_register_state_dict_hook', '_replicate_for_data_parallel', '_save_to_state_dict', '_slow_forward', '_state_dict_hooks', '_state_dict_pre_hooks', '_version', '_wrap_distributed', '', 'set_extra_state', 'share_memory', 'state_dict', 'to', 'to_empty', 'train', 'training', 'type', 'xpu', 'zero_grad']
- Assistant
- User
- Assistant
- User
i have converted it to onnx now how to use it ?
- Assistant
- User
i takes wav as input
- Assistant
- User
InvalidArgument Traceback (most recent call last) Cell In[47], line 1 ----> 1 outputs = session.run(None, input_data)
File ~/anaconda3/lib/python3.11/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py:220, in Session.run(self, output_names, input_feed, run_options) 218 output_names = [output.name for output in self._outputs_meta] 219 try: --> 220 return self._sess.run(output_names, input_feed, run_options) 221 except C.EPFail as err: 222 if self._enable_fallback:
InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Got invalid dimensions for input: input for the following indices index: 1 Got: 96929 Expected: 16000 Please fix either the inputs/outputs or the model.
- Assistant
- User
here is the output it doesnot show emotions Model outputs: [[[-8.00093710e-02 8.58848915e-02 -3.14629108e-01 ... -6.64856732e-02 1.47800907e-01 -1.04568899e-05] [ 1.05670422e-01 1.07884541e-01 -3.30827445e-01 ... -3.67167965e-02 -3.87382135e-02 2.97026206e-02] [ 1.12758294e-01 5.06372154e-02 -2.19909534e-01 ... 1.02727212e-01 -4.58532795e-02 1.62000105e-01] ... [-2.03499615e-01 -3.27208638e-02 -7.60765746e-02 ... -8.97993967e-02 -2.17820093e-01 6.14969246e-03] [-1.56180128e-01 7.80829415e-02 -6.43046200e-02 ... -1.41608015e-01 -1.42639592e-01 -5.30315414e-02] [-3.66249323e-01 1.27386495e-01 -8.70838240e-02 ... 8.26608613e-02 -7.20534995e-02 -1.67876691e-01]]] [[[ 2.84745574e-01 4.93211567e-01 -1.58373564e-02 ... 4.23437029e-01 5.02736820e-03 5.34641862e-01] [-2.19813898e-01 -4.84210283e-01 1.19895071e-01 ... 5.55972010e-02 8.94276518e-03 -2.02420980e-01] [-2.31575415e-01 -1.03821290e+00 1.08173445e-01 ... 4.81584936e-01 1.05606113e-02 -1.69688269e-01] ... [-1.96951687e-01 -1.49350882e+00 8.10474083e-02 ... 2.03197971e-01 2.75121927e-02 -2.93219388e-01] [-1.24559134e-01 -2.03693700e+00 3.96615192e-02 ... -1.05476417e-01 1.99893471e-02 -6.36209071e-01] [-7.94349685e-02 -1.48650742e+00 1.32194236e-01 ... 7.51562417e-04 2.31911782e-02 -2.79704988e-01]]]
- Assistant