seamless_communication icon indicating copy to clipboard operation
seamless_communication copied to clipboard

Cast error details: Unable to cast Python instance of type <class 'pathlib.PosixPath'> to C++ type '?' (#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details)

Open liuhao0813 opened this issue 8 months ago • 0 comments

m4t_predict --task S2ST --tgt_lang cmn --src_lang eng --model_name seamlessM4T_v2_large --output_path ./ddd.mp3 ./test.mp3

python 3.10 mac os 12.7.5 inter x86_64

(.venv) ➜ seamless_communication git:(main) ✗ m4t_predict --task S2ST --tgt_lang cmn --src_lang eng --model_name seamlessM4T_v2_large --output_path ./ddd.mp3 ./test.mp3 2024-06-13 23:12:10,180 INFO -- seamless_communication.cli.m4t.predict.predict: Running inference on device=device(type='cpu') with dtype=torch.float32. Using the cached checkpoint of seamlessM4T_v2_large. Set force to True to download again. Using the cached tokenizer of seamlessM4T_v2_large. Set force to True to download again. Using the cached tokenizer of seamlessM4T_v2_large. Set force to True to download again. Using the cached tokenizer of seamlessM4T_v2_large. Set force to True to download again. Using the cached checkpoint of vocoder_v2. Set force to True to download again. /Users/liuhao/seamless_communication/.venv/lib/python3.10/site-packages/torch/nn/utils/weight_norm.py:28: UserWarning: torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm. warnings.warn("torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm.") 2024-06-13 23:13:26,458 INFO -- seamless_communication.cli.m4t.predict.predict: text_generation_opts=SequenceGeneratorOptions(beam_size=5, soft_max_seq_len=(1, 200), hard_max_seq_len=1024, step_processor=None, unk_penalty=0.0, len_penalty=1.0) 2024-06-13 23:13:26,460 INFO -- seamless_communication.cli.m4t.predict.predict: unit_generation_opts=SequenceGeneratorOptions(beam_size=5, soft_max_seq_len=(25, 50), hard_max_seq_len=1024, step_processor=None, unk_penalty=0.0, len_penalty=1.0) 2024-06-13 23:13:26,460 INFO -- seamless_communication.cli.m4t.predict.predict: unit_generation_ngram_filtering=False 2024-06-13 23:13:26,549 WARNING -- seamless_communication.inference.translator: Transposing audio tensor from (bsz, seq_len) -> (seq_len, bsz). 2024-06-13 23:13:40,971 INFO -- seamless_communication.cli.m4t.predict.predict: Saving translated audio in cmn Traceback (most recent call last): File "/Users/liuhao/seamless_communication/.venv/bin/m4t_predict", line 8, in sys.exit(main()) File "/Users/liuhao/seamless_communication/.venv/lib/python3.10/site-packages/seamless_communication/cli/m4t/predict/predict.py", line 258, in main torchaudio.save( File "/Users/liuhao/seamless_communication/.venv/lib/python3.10/site-packages/torchaudio/_backend/utils.py", line 313, in save return backend.save( File "/Users/liuhao/seamless_communication/.venv/lib/python3.10/site-packages/torchaudio/_backend/sox.py", line 72, in save sox_ext.save_audio_file( File "/Users/liuhao/seamless_communication/.venv/lib/python3.10/site-packages/torch/_ops.py", line 755, in call return self._op(*args, **(kwargs or {})) RuntimeError: torchaudio_sox::save_audio_file() Expected a value of type 'str' for argument '_0' but instead found type 'PosixPath'. Position: 0 Value: PosixPath('ddd.mp3') Declaration: torchaudio_sox::save_audio_file(str _0, Tensor _1, int _2, bool _3, float? _4, str? _5, str? _6, int? _7) -> () Cast error details: Unable to cast Python instance of type <class 'pathlib.PosixPath'> to C++ type '?' (#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details) [1] 59505 segmentation fault m4t_predict --task S2ST --tgt_lang cmn --src_lang eng --model_name ./ddd.mp

liuhao0813 avatar Jun 13 '24 15:06 liuhao0813