ValueError: operands could not be broadcast together with remapped shapes [original->remapped]: (2,2) and requested shape (3,2)
#3
by
Yehor
- opened
Hello! When I try to run the code I get the following stack trace:
Traceback (most recent call last):
File "/root/whisper-intel-optimized/run.py", line 30, in <module>
input_features = processor(
^^^^^^^^^^
File "/root/whisper-intel-optimized/.venv/lib/python3.12/site-packages/transformers/models/whisper/processing_whisper.py", line 69, in __call__
inputs = self.feature_extractor(audio, *args, sampling_rate=sampling_rate, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/whisper-intel-optimized/.venv/lib/python3.12/site-packages/transformers/models/whisper/feature_extraction_whisper.py", line 282, in __call__
padded_inputs = self.pad(
^^^^^^^^^
File "/root/whisper-intel-optimized/.venv/lib/python3.12/site-packages/transformers/feature_extraction_sequence_utils.py", line 210, in pad
outputs = self._pad(
^^^^^^^^^^
File "/root/whisper-intel-optimized/.venv/lib/python3.12/site-packages/transformers/feature_extraction_sequence_utils.py", line 282, in _pad
processed_features[self.model_input_names[0]] = np.pad(
^^^^^^^
File "/root/whisper-intel-optimized/.venv/lib/python3.12/site-packages/numpy/lib/arraypad.py", line 748, in pad
pad_width = _as_pairs(pad_width, array.ndim, as_index=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/whisper-intel-optimized/.venv/lib/python3.12/site-packages/numpy/lib/arraypad.py", line 522, in _as_pairs
return np.broadcast_to(x, (ndim, 2)).tolist()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/whisper-intel-optimized/.venv/lib/python3.12/site-packages/numpy/lib/stride_tricks.py", line 413, in broadcast_to
return _broadcast_to(array, shape, subok=subok, readonly=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/whisper-intel-optimized/.venv/lib/python3.12/site-packages/numpy/lib/stride_tricks.py", line 349, in _broadcast_to
it = np.nditer(
^^^^^^^^^^
ValueError: operands could not be broadcast together with remapped shapes [original->remapped]: (2,2) and requested shape (3,2)
Input tensor is torch.Size([1, 246936]), sr=16000
The code to reproduce: https://github.com/egorsmkv/whisper-intel-optimized
Any suggestions what can be wrong here?
Fixed
Yehor
changed discussion status to
closed