Immutable solution version
RuntimeError: Deserialization Fails on CPU-Only Systems Due to CUDA Mapping in torch.load
Complete solution
Shows how to fix runtimeError: Deserialization Fails on CPU-Only Systems Due to CUDA Mapping in torch.load. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
If you do have a GPU but still hit the error, install the matching CUDA torch build instead (one user confirmed torch 2.6.0+cu118 with torchvision 0.21.0+cu118 and torchaudio 2.6.0+cu118 fixed it).
Steps
- Issue resemble-ai/chatterbox#96 (closed, 9 comments): I encountered a RuntimeError when attempting to run ChatterboxTTS on a CPU-only system. The issue stems from attempting to deserialize a checkpoint intended for CUDA on a system where torch.cuda.isavailable() is False. Additionally, a UserWarning is issued regarding the deprecation of pkgresources, which will be removed as early as November 2025. `` [HOME]/... UserWarning: pkgresources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkgresources.html.
- If ChatterboxTTS fails on a CPU-only machine with a CUDA deserialization RuntimeError, patch torch.load to default maplocation to 'cpu' before calling frompretrained, then restore it. If you do have a GPU but still hit the error, install the matching CUDA torch build instead (one user confirmed torch 2.6.0+cu118 with torchvision 0.21.0+cu118 and torchaudio 2.6.0+cu118 fixed it).
When to use
You are seeing this: The issue stems from attempting to deserialize a checkpoint intended for CUDA on a system where torch.cuda.is_available() is False. Use this skill when you run into "RuntimeError: Deserialization Fails on CPU-Only Systems Due to CUDA Mapping in torch.load".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: torch 2.6.0+cu118, torchvision 0.21.0+cu118. If you are on something much newer or older, the details may have shifted.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Sources
- https://setuptools.pypa.io/en/latest/pkg_resources.html
Evidence
In the GitHub issue gh:resemble-ai/chatterbox#96 (https://github.com/resemble-ai/chatterbox/issues/96), the problem reported was: Issue resemble-ai/chatterbox#96 (closed, 9 comments): I encountered a RuntimeError when attempting to run ChatterboxTTS on a CPU-only system. The issue stems from attempting to deserialize a checkpoint intended for CUDA on a system where torch.cuda.isavailable() is False. Additionally, a UserWarning is issued regarding the deprecation of pkgresources, which will be removed as early as November 2025. `` [HOME]/... UserWarning: pkgresources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkgresources.html. The verified resolution was: If ChatterboxTTS fails on a CPU-only machine with a CUDA deserialization RuntimeError, patch torch.load to default maplocation to 'cpu' before calling frompretrained, then restore it. If you do have a GPU but still hit the error, install the matching CUDA torch build instead (one user confirmed torch 2.6.0+cu118 with torchvision 0.21.0+cu118 and torchaudio 2.6.0+cu118 fixed it).
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_jKCe9NTx7wB581Y6T2ibKQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">RuntimeError: Deserialization Fails on CPU-Only Systems Due to CUDA Mapping in torch.load <span>— Vectle</span></a>