Skip to content

Commit

Permalink
Update 说明.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Davezqq authored Aug 4, 2019
1 parent dc220fd commit 54cc39d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions 说明.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
### 1.2 训练方法
 设置训练数据路径,需要修改的文件为honk-master/utils/model.py,将该文件中default_config中data_folder修改为自己的文件夹。
 设置目标词,需要修改的文件为honk-master/utils/model.py,将该文件中default_config中wanted_words修改为自己要识别的关键词,格式为["关键词1","关键词2"].
 设置目标模型类型,加入参数--model 目标模型类型,可选的模型类型可以在utils/model.py文件中的ConfigType中查看。
 输出文件默认放置在honk-master/model文件夹下,命名为model.pt,若要自定义输出路径,则修改utils/train.py文件下main函数中output_file项
 训练CNN可以使用如下命令(使用默认的类型)
`python -m utils.train --type [train|eval]`
 训练RES模型推荐使用如下命令
`python -m utils.train --wanted_words yes no up down left right on off stop go --dev_every 1 --n_labels 12 --n_epochs 26 --weight_decay 0.00001 --lr 0.1 0.01 0.001 --schedule 3000 6000 --model res{8,15,26}[-narrow]`
若要使用CUDA,请将utils/train.py下global_config中的no_cuda字段设置为False,并设置gpu_no为想要运行的gpu序号
 设置目标模型类型,加入参数--model 目标模型类型,可选的模型类型可以在utils/model.py文件中的ConfigType中查看。
 输出文件默认放置在honk-master/model文件夹下,命名为model.pt,若要自定义输出路径,则修改utils/train.py文件下main函数中output_file项
 训练CNN可以使用如下命令(使用默认的类型)
`python -m utils.train --type [train|eval]`
 训练RES模型推荐使用如下命令
`python -m utils.train --wanted_words yes no up down left right on off stop go --dev_every 1 --n_labels 12 --n_epochs 26 --weight_decay 0.00001 --lr 0.1 0.01 0.001 --schedule 3000 6000 --model res{8,15,26}[-narrow]`
若要使用CUDA,请将utils/train.py下global_config中的no_cuda字段设置为False,并设置gpu_no为想要运行的gpu序号
## 2.使用模型
### 2.1设置config文件
 设置输入模型路径,修改model_path字段
 设置关键词,修改commands字段,要与训练模型时的关键词相同
 若使用的模型是pt后缀,则设置backend为pytorch,若使用的是onnx模型,则设置backend为caffe2
 设置输入模型路径,修改model_path字段
 设置关键词,修改commands字段,要与训练模型时的关键词相同
 若使用的模型是pt后缀,则设置backend为pytorch,若使用的是onnx模型,则设置backend为caffe2
## 3.服务端运行
 在honk-master文件夹下使用命令`python3 .`,运行服务器端程序,默认端口为16888
若没有报错则服务器端正常运行
 在honk-master文件夹下使用命令`python3 .`,运行服务器端程序,默认端口为16888
若没有报错则服务器端正常运行
## 4.客户端运行
 由于honk引擎是植入在dingdang中的,要使用honk作为唤醒引擎时,需要设置.dingdang/profile文件下的stt_passive_engine为honk,再修改honk字段下的endpoint为运行服务端的机器ip地址

0 comments on commit 54cc39d

Please sign in to comment.