TypeError: expected np.ndarray (got numpy.ndarray) #2300
Unanswered
ScarletCurry
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Originally, I was able to transform any MP4 video into subtitle file, but now I encounter an error when I type the command whisper xx.mp4. I couldn’t understand the solutions I found on Google.
C:\Users\ScarletCurry\AppData\Local\Programs\Python\Python312\Lib\site-packages\whisper_init_.py:146: FutureWarning: You are using
torch.load
withweights_only=False
(the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value forweights_only
will be flipped toTrue
. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user viatorch.serialization.add_safe_globals
. We recommend you start settingweights_only=True
for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.checkpoint = torch.load(fp, map_location=device)
Traceback (most recent call last):
File "", line 198, in run_module_as_main
File "", line 88, in run_code
File "C:\Users\ScarletCurry\AppData\Local\Programs\Python\Python312\Scripts\whisper.exe_main.py", line 7, in
File "C:\Users\ScarletCurry\AppData\Local\Programs\Python\Python312\Lib\site-packages\whisper\transcribe.py", line 577, in cli
model = load_model(model_name, device=device, download_root=model_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ScarletCurry\AppData\Local\Programs\Python\Python312\Lib\site-packages\whisper_init.py", line 154, in load_model
model.set_alignment_heads(alignment_heads)
File "C:\Users\ScarletCurry\AppData\Local\Programs\Python\Python312\Lib\site-packages\whisper\model.py", line 251, in set_alignment_heads
mask = torch.from_numpy(array).reshape(
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected np.ndarray (got numpy.ndarray)
Beta Was this translation helpful? Give feedback.
All reactions