wenet
wenet copied to clipboard
export_onnx_gpu error
when I do this operation, python export_onnx_gpu.py --config=$model_dir/train.yaml --checkpoint=$model_dir/final.pt --cmvn_file=$model_dir/global_cmvn --ctc_weight=0.5 --output_onnx_dir=$onnx_model_dir --fp16
terminate called after throwing an instance of 'c10::Error'
what(): Tried to register multiple backend fallbacks for the same dispatch key Batched; previous registration registered at /opt/conda/conda-bld/pytorch_1634272172048/work/aten/src/ATen/BatchingRegistrations.cpp:1016, new registration registered at ../aten/src/ATen/BatchingRegistrations.cpp:1016
Exception raised from registerFallback at ../aten/src/ATen/core/dispatch/Dispatcher.cpp:267 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::string) + 0x42 (0x7f5ec09014b2 in /home/yjx/miniconda3/envs/wenet/lib/python3.8/site-packages/wenet.libs/libc10-e6e91872.so)
frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::string const&) + 0x5b (0x7f5ec08fddbb in /home/yjx/miniconda3/envs/wenet/lib/python3.8/site-packages/wenet.libs/libc10-e6e91872.so)
frame #2: c10::Dispatcher::registerFallback(c10::DispatchKey, c10::KernelFunction, std::string) + 0x958 (0x7f5ec1bc1e98 in /home/yjx/miniconda3/envs/wenet/lib/python3.8/site-packages/wenet.libs/libtorch_cpu-a07078e3.so)
frame #3: torch::Library::_fallback(torch::CppFunction&&) & + 0x195 (0x7f5ec1bf6f65 in /home/yjx/miniconda3/envs/wenet/lib/python3.8/site-packages/wenet.libs/libtorch_cpu-a07078e3.so)
frame #4:
已放弃(吐核)
how to fix it ? thanks
I have no idea about it. You may try:
- export PYTHONPATH=$PYTHONPATH:/your-git-clone/wenet/, rather than using wenet from pip isntall
- Make sure you have cuda available, maybe try it in docker image e.g. https://github.com/wenet-e2e/wenet/blob/main/runtime/gpu/Dockerfile/Dockerfile.server
meet the same error,solved by uninstall wenet by pip。 since in your error message: /home/yjx/miniconda3/envs/wenet/lib/python3.8/site-packages/wenet.libs/libtorch_cpu-a07078e3.so guess this libtorch_cpu may conflict with gpu version than cause this error
fixed, close this issue