"server/custom_kernels/setup.py" did not exist on "19c41824cb11ba1a3b60a2a65274d8c074383de3"
README.md 2.41 KB
Newer Older
zhanggezhong's avatar
zhanggezhong committed
1
# <div align="center"><strong>TorchAudio</strong></div>
Soumith Chintala's avatar
Soumith Chintala committed
2

zhanggezhong's avatar
zhanggezhong committed
3
## 简介
4

zhanggezhong's avatar
zhanggezhong committed
5
torchaudio 的目标是将 PyTorch 应用于音频领域。通过支持 PyTorch,torchaudio 遵循了相同的理念,即提供强大的 DCU 加速,注重通过 autograd 系统实现可训练的特性,并保持一致的风格(张量命名和维度命名)。因此,它主要是一个机器学习库,而不是一个通用的信号处理库。PyTorch 的优势在 torchaudio 中得以体现,所有计算都通过 PyTorch 操作完成,这使得它易于使用,并且像 PyTorch 的自然扩展。torchaudio官方github地址:[GitHub - pytorch/audio: Data manipulation and transformation for audio signal processing, powered by PyTorch](https://github.com/pytorch/audio)
moto's avatar
moto committed
6

zhanggezhong's avatar
zhanggezhong committed
7
8
9
10
11
- 支持音频输入输出(加载文件,保存文件)
  
  - 使用 SoX 将各种音频格式(如 wav、mp3、ogg、flac、opus、sphere)加载到 PyTorch 的张量中。  
  
  - 支持 Kaldi(ark/scp)格式。
jamarshon's avatar
jamarshon committed
12

zhanggezhong's avatar
zhanggezhong committed
13
14
15
- 数据加载器
  
  - 提供常见音频数据集的数据加载器。  
Soumith Chintala's avatar
Soumith Chintala committed
16

zhanggezhong's avatar
zhanggezhong committed
17
18
19
- 音频与语音处理功能
  
  - 强制对齐(forced_align)。  
Soumith Chintala's avatar
Soumith Chintala committed
20

zhanggezhong's avatar
zhanggezhong committed
21
22
23
- 常用音频变换
  
  - 提供如频谱图、AmplitudeToDB、MelScale、MelSpectrogram、MFCC、MuLaw 编码与解码、重采样等常用的音频变换。  
24

zhanggezhong's avatar
zhanggezhong committed
25
26
27
- 兼容性接口
  
  - 通过 PyTorch 运行与其他库(如 Kaldi)对齐的代码,包括频谱图、fbank、MFCC 等功能。
28

zhanggezhong's avatar
zhanggezhong committed
29
## 安装
SeanNaren's avatar
SeanNaren committed
30

zhanggezhong's avatar
zhanggezhong committed
31
### 适用环境
Vincent QB's avatar
Vincent QB committed
32

zhanggezhong's avatar
zhanggezhong committed
33
- ubuntu20.04 或 rocky8.6
jamarshon's avatar
jamarshon committed
34

zhanggezhong's avatar
zhanggezhong committed
35
- Python==3.10
Vincent QB's avatar
Vincent QB committed
36

zhanggezhong's avatar
zhanggezhong committed
37
- PyTorch==2.5.1 DTK=25.04
yangarbiter's avatar
yangarbiter committed
38

zhanggezhong's avatar
zhanggezhong committed
39
40
41
42
43
44
45
46
### 使用pip方式安装
```shell
pip install torchaudio* # (请下载对应操作系统的torchaudio的whl包)
```

### 源码编译安装

#### 编译环境准备
yangarbiter's avatar
yangarbiter committed
47

zhanggezhong's avatar
zhanggezhong committed
48
49
50
51
- 拉取torchaudio代码

```shell
git clone -b v2.5.1-hcu http://developer.hpccube.com/codes/OpenDAS/torchaudio.git
yangarbiter's avatar
yangarbiter committed
52
53
```

zhanggezhong's avatar
zhanggezhong committed
54
- 导入环境变量以及安装必要依赖库
zhanggezhong's avatar
zhanggezhong committed
55
安装fastpt-2.1.0版本, cmake 版本要求3.19.0
zhanggezhong's avatar
zhanggezhong committed
56
57

```shell
zhanggezhong's avatar
zhanggezhong committed
58
source /usr/local/bin/fastpt -c
zhanggezhong's avatar
zhanggezhong committed
59
60
61
62

使用audio时执行

```shell
zhanggezhong's avatar
zhanggezhong committed
63
source /usr/local/bin/fastpt -e
moto's avatar
moto committed
64
65
```

zhanggezhong's avatar
zhanggezhong committed
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#### 编译安装

- 执行编译命令并安装

```shell
python3  setup.py  bdist_wheel
pip install dist/torchaudio*
```

## 版本号查询

```shell
python -c "import torchaudio; print(torchaudio.__version__)"
```
Vincent QB's avatar
Vincent QB committed
80

zhanggezhong's avatar
zhanggezhong committed
81
- 版本号与官方版本同步,查询该软件的版本号,例如2.5.1;
Vincent QB's avatar
Vincent QB committed
82

zhanggezhong's avatar
zhanggezhong committed
83
## Known Issue
84

zhanggezhong's avatar
zhanggezhong committed
85
- 无 
86

zhanggezhong's avatar
zhanggezhong committed
87
## 其他参考
88

zhanggezhong's avatar
zhanggezhong committed
89
- [README_ORIGIN](README_ORIGIN.md)
90

zhanggezhong's avatar
zhanggezhong committed
91
- [GitHub - pytorch/audio](https://github.com/pytorch/audio)