chunk(): argument 'chunks' (position 2) must be int, not NoneType #298

Closed
opened 2023-07-07 15:09:26 +00:00 by bluetooth · 1 comment

I'm trying to use a finetuned model on a new machine, I copy+pasted it from my local to the other machine, but when I try to use the CLI to generate the tts, I am getting a chunk(): argument 'chunks' (position 2) must be int, not NoneType error.

Here is the full stacktrace:

(venv) root:~/ai-voice-cloning# python ./src/cli.py  --text="Hello world" --voice="itsme"
Loading TorToiSe... (AR: None, diffusion: None, vocoder: bigvgan_24khz_100band)
Hardware acceleration found: cuda
Loading tokenizer JSON: /root/ai-voice-cloning/modules/tortoise-tts/tortoise/../tortoise/data/tokenizer.json
Loaded tokenizer
Loading autoregressive model: /root/ai-voice-cloning/models/tortoise/autoregressive.pth
Loaded autoregressive model
Loaded diffusion model
Loading vocoder model: bigvgan_24khz_100band
Loading vocoder model: bigvgan_24khz_100band.pth
Removing weight norm...
Loaded vocoder model
Loaded TTS, ready for generation.
[1/1] Generating line: Hello world
Loading voice: itsme with model d1f79232
/root/ai-voice-cloning/venv/lib/python3.9/site-packages/torchaudio/functional/functional.py:1458: UserWarning: "kaiser_window" resampling method name is being deprecated and replaced by "sinc_interp_kaiser" in the next release. The default behavior remains unchanged.
  warnings.warn(
Traceback (most recent call last):
  File "/root/ai-voice-cloning/./src/cli.py", line 81, in <module>
    generate(**kwargs)
  File "/root/ai-voice-cloning/src/utils.py", line 211, in generate
    return generate_tortoise(**kwargs)
  File "/root/ai-voice-cloning/src/utils.py", line 1047, in generate_tortoise
    settings = get_settings( override=override )
  File "/root/ai-voice-cloning/src/utils.py", line 909, in get_settings
    settings['voice_samples'], settings['conditioning_latents'], _ = fetch_voice(voice=selected_voice)
  File "/root/ai-voice-cloning/src/utils.py", line 846, in fetch_voice
    conditioning_latents = compute_latents(voice=voice, voice_samples=voice_samples, voice_latents_chunks=parameters['voice_latents_chunks'])
  File "/root/ai-voice-cloning/src/utils.py", line 1309, in compute_latents
    conditioning_latents = tts.get_conditioning_latents(voice_samples, return_mels=not args.latents_lean_and_mean, slices=voice_latents_chunks, force_cpu=args.force_cpu_for_conditioning_latents, original_ar=original_ar, original_diffusion=original_diffusion)
  File "/root/ai-voice-cloning/modules/tortoise-tts/tortoise/api.py", line 706, in get_conditioning_latents
    chunks = torch.chunk(concat, slices, dim=1)
TypeError: chunk(): argument 'chunks' (position 2) must be int, not NoneType
I'm trying to use a finetuned model on a new machine, I copy+pasted it from my local to the other machine, but when I try to use the CLI to generate the tts, I am getting a `chunk(): argument 'chunks' (position 2) must be int, not NoneType` error. Here is the full stacktrace: ```bash (venv) root:~/ai-voice-cloning# python ./src/cli.py --text="Hello world" --voice="itsme" Loading TorToiSe... (AR: None, diffusion: None, vocoder: bigvgan_24khz_100band) Hardware acceleration found: cuda Loading tokenizer JSON: /root/ai-voice-cloning/modules/tortoise-tts/tortoise/../tortoise/data/tokenizer.json Loaded tokenizer Loading autoregressive model: /root/ai-voice-cloning/models/tortoise/autoregressive.pth Loaded autoregressive model Loaded diffusion model Loading vocoder model: bigvgan_24khz_100band Loading vocoder model: bigvgan_24khz_100band.pth Removing weight norm... Loaded vocoder model Loaded TTS, ready for generation. [1/1] Generating line: Hello world Loading voice: itsme with model d1f79232 /root/ai-voice-cloning/venv/lib/python3.9/site-packages/torchaudio/functional/functional.py:1458: UserWarning: "kaiser_window" resampling method name is being deprecated and replaced by "sinc_interp_kaiser" in the next release. The default behavior remains unchanged. warnings.warn( Traceback (most recent call last): File "/root/ai-voice-cloning/./src/cli.py", line 81, in <module> generate(**kwargs) File "/root/ai-voice-cloning/src/utils.py", line 211, in generate return generate_tortoise(**kwargs) File "/root/ai-voice-cloning/src/utils.py", line 1047, in generate_tortoise settings = get_settings( override=override ) File "/root/ai-voice-cloning/src/utils.py", line 909, in get_settings settings['voice_samples'], settings['conditioning_latents'], _ = fetch_voice(voice=selected_voice) File "/root/ai-voice-cloning/src/utils.py", line 846, in fetch_voice conditioning_latents = compute_latents(voice=voice, voice_samples=voice_samples, voice_latents_chunks=parameters['voice_latents_chunks']) File "/root/ai-voice-cloning/src/utils.py", line 1309, in compute_latents conditioning_latents = tts.get_conditioning_latents(voice_samples, return_mels=not args.latents_lean_and_mean, slices=voice_latents_chunks, force_cpu=args.force_cpu_for_conditioning_latents, original_ar=original_ar, original_diffusion=original_diffusion) File "/root/ai-voice-cloning/modules/tortoise-tts/tortoise/api.py", line 706, in get_conditioning_latents chunks = torch.chunk(concat, slices, dim=1) TypeError: chunk(): argument 'chunks' (position 2) must be int, not NoneType ```

How do you solve this problem?

How do you solve this problem?
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mrq/ai-voice-cloning#298
No description provided.