Giter Site home page Giter Site logo

Comments (6)

Slyne avatar Slyne commented on September 25, 2024

Could you attach your config.pbtxt from encoder and feature_extractor?
Looks like the configuration file is not quite right.

from wenet.

pjhool avatar pjhool commented on September 25, 2024

attatched config.pbtxt files for encoder, feature_extractor.

  1. encoder config.pbtxt
    config.pbtxt.txt

name: "encoder"
backend: "onnxruntime"
default_model_filename: "encoder.onnx"

max_batch_size: 512

sequence_batching{
max_sequence_idle_microseconds: 5000000
oldest {
max_candidate_sequences: 1024
max_queue_delay_microseconds: 5000
}
control_input [
]
state [
{
input_name: "offset"
output_name: "r_offset"
data_type: TYPE_INT64
dims: [ 1 ]
initial_state: {
data_type: TYPE_INT64
dims: [ 1 ]
zero_data: true
name: "initial state"
}
},
{
input_name: "att_cache"
output_name: "r_att_cache"
data_type: TYPE_FP16
dims: [ #num_layers, #num_head, #cache_size, #att_cache_output_size ]
initial_state: {
data_type: TYPE_FP16
dims: [ #num_layers, #num_head, #cache_size, #att_cache_output_size ]
zero_data: true
name: "initial state"
}
},
{
input_name: "cnn_cache"
output_name: "r_cnn_cache"
data_type: TYPE_FP16
dims: [#num_layers, 256, #cnn_module_cache]
initial_state: {
data_type: TYPE_FP16
dims: [#num_layers, 256, #cnn_module_cache]
zero_data: true
name: "initial state"
}
},
{
input_name: "cache_mask"
output_name: "r_cache_mask"
data_type: TYPE_FP16
dims: [1, #cache_size]
initial_state: {
data_type: TYPE_FP16
dims: [1, #cache_size]
zero_data: true
name: "initial state"
}
}
]
}
input [
{
name: "chunk_xs"
data_type: TYPE_FP16
dims: [#decoding_window, 80]
},
{
name: "chunk_lens"
data_type: TYPE_INT32
dims: [ 1 ]
reshape: { shape: [] }
}
]
output [
{
name: "log_probs"
data_type: TYPE_FP16
dims: [-1, 10] # [-1, beam_size]
},
{
name: "log_probs_idx"
data_type: TYPE_INT64
dims: [-1, 10] # [-1, beam_size]
},
{
name: "chunk_out"
data_type: TYPE_FP16
dims: [-1, -1]
},
{
name: "chunk_out_lens"
data_type: TYPE_INT32
dims: [1]
reshape: { shape: [] }
}
]
instance_group [
{
count: 2
kind: KIND_GPU
}
]

config_template.pbtxt.txt
config_template.pbtxt.txt

config_template2.pbtxt.txt
config_template2.pbtxt.txt

  1. feature_extractor config.pbtxt
    config.pbtxt.txt

name: "feature_extractor"
backend: "python"
max_batch_size: 512

parameters [
{
key: "frame_length_ms",
value: { string_value: "#frame_length" }
},
{
key: "frame_shift_ms"
value: { string_value: "#frame_shift" }
},
{
key: "sample_rate"
value: { string_value: "#sample_rate" }
},
{
key: "chunk_size_s",
value: { string_value: "#chunk_size_in_seconds" }
}
]
sequence_batching{
max_sequence_idle_microseconds: 5000000
oldest {
max_candidate_sequences: 512
preferred_batch_size: [ 32, 64, 128, 256]
}
control_input [
{
name: "START",
control [
{
kind: CONTROL_SEQUENCE_START
fp32_false_true: [0, 1]
}
]
},
{
name: "READY"
control [
{
kind: CONTROL_SEQUENCE_READY
fp32_false_true: [0, 1]
}
]
},
{
name: "CORRID",
control [
{
kind: CONTROL_SEQUENCE_CORRID
data_type: TYPE_UINT64
}
]
},
{
name: "END",
control [
{
kind: CONTROL_SEQUENCE_END
fp32_false_true: [0, 1]
}
]
}
]
}
input [
{
name: "wav"
data_type: TYPE_FP32
dims: [-1]
},
{
name: "wav_lens"
data_type: TYPE_INT32
dims: [1]
}
]
output [
{
name: "speech"
data_type: TYPE_#DTYPE # FP32
dims: [#decoding_window, #num_mel_bins]
},
{
name: "speech_lengths"
data_type: TYPE_INT32
dims: [1]
}
]
instance_group [
{
count: 2
kind: KIND_GPU
}
]

model.py
model.py.txt

config_template.pbtxt.txt
config_template.pbtxt.txt

from wenet.

Slyne avatar Slyne commented on September 25, 2024

from wenet.

pjhool avatar pjhool commented on September 25, 2024

run the same command as above
-- python3 -m wenet.bin.export_onnx_gpu --config $EXP/train.yaml --checkpoint $EXP/final_10.pt --cmvn_file=$EXP/global_cmvn --ctc_weight=0.5 --output_onnx_dir $onnx_dir --fp16

from wenet.

Slyne avatar Slyne commented on September 25, 2024

run the same command as above -- python3 -m wenet.bin.export_onnx_gpu --config $EXP/train.yaml --checkpoint $EXP/final_10.pt --cmvn_file=$EXP/global_cmvn --ctc_weight=0.5 --output_onnx_dir $onnx_dir --fp16

Please also add --streaming if you are using streaming model.

from wenet.

pjhool avatar pjhool commented on September 25, 2024

It works!!

from wenet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.