You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue while running Encodec on Termux, a terminal emulator for Android. The problem arises from the encodec/distrib.py file, specifically the is_distributed() function and the all_reduce() function.
To Reproduce
Install Encodec on Termux.
Run any Encodec command that uses the encodec/distrib.py file.
Observe the AttributeError that occurs when torch.distributed.ReduceOp.SUM is called in the all_reduce() function.
Expected behavior
I expected the Encodec command to run without any errors.
Actual Behavior
An AttributeError occurred because the torch.distributed module is not available in a non-distributed environment like Termux.
Your Environment
Python version: 3.11.8
PyTorch version: 2
Operating system: Android 11 aarch64
Shell: /data/data/com.termux/files/usr/bin/bash
Hardware: Droid
Fyi, after disabling, it runs:
Success: no issues found in 19 source files python3 -m encodec.binary <frozen runpy>:128: RuntimeWarning: 'encodec.binary' found in sys.modules after import of package 'encodec', but prior to execution of 'encodec.binary'; this may result in unpredictable behaviour python3 -m encodec.compress <frozen runpy>:128: RuntimeWarning: 'encodec.compress' found in sys.modules after import of package 'encodec', but prior to execution of 'encodec.compress'; this may result in unpredictable behaviour /data/data/com.termux/files/usr/lib/python3.11/site-packages/torch/nn/utils/weight_norm.py:30: 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.") Doing encodec_24khz, use_lm=False /data/data/com.termux/files/usr/lib/python3.11/site-packages/torch/nn/utils/weight_norm.py:30: 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.") kbps: 12.1, time comp: 8.4 sec. time decomp:4.5. Doing encodec_24khz, use_lm=True Downloading: "https://dl.fbaipublicfiles.com/encodec/v0/encodec_lm_24khz-1608e3c0.th" to /data/data/com.termux/files/home/.cache/torch/hub/checkpoints/encodec_lm_24khz-1608e3c0.th 27%|██▏ | 15.9M/59.4M [04:57<
The text was updated successfully, but these errors were encountered:
🐛 Bug Report
I encountered an issue while running Encodec on Termux, a terminal emulator for Android. The problem arises from the
encodec/distrib.py
file, specifically theis_distributed()
function and theall_reduce()
function.To Reproduce
encodec/distrib.py
file.AttributeError
that occurs whentorch.distributed.ReduceOp.SUM
is called in theall_reduce()
function.Expected behavior
I expected the Encodec command to run without any errors.
Actual Behavior
An
AttributeError
occurred because thetorch.distributed
module is not available in a non-distributed environment like Termux.Your Environment
Fyi, after disabling, it runs:
Success: no issues found in 19 source files python3 -m encodec.binary <frozen runpy>:128: RuntimeWarning: 'encodec.binary' found in sys.modules after import of package 'encodec', but prior to execution of 'encodec.binary'; this may result in unpredictable behaviour python3 -m encodec.compress <frozen runpy>:128: RuntimeWarning: 'encodec.compress' found in sys.modules after import of package 'encodec', but prior to execution of 'encodec.compress'; this may result in unpredictable behaviour /data/data/com.termux/files/usr/lib/python3.11/site-packages/torch/nn/utils/weight_norm.py:30: 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.") Doing encodec_24khz, use_lm=False /data/data/com.termux/files/usr/lib/python3.11/site-packages/torch/nn/utils/weight_norm.py:30: 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.") kbps: 12.1, time comp: 8.4 sec. time decomp:4.5. Doing encodec_24khz, use_lm=True Downloading: "https://dl.fbaipublicfiles.com/encodec/v0/encodec_lm_24khz-1608e3c0.th" to /data/data/com.termux/files/home/.cache/torch/hub/checkpoints/encodec_lm_24khz-1608e3c0.th 27%|██▏ | 15.9M/59.4M [04:57<
The text was updated successfully, but these errors were encountered: