Giter VIP home page Giter VIP logo

Comments (6)

HaujetZhao avatar HaujetZhao commented on July 16, 2024

按照 models 文件夹里面的文本文件里所写的方法下载标点符号模型

from capswriter-offline.

HaujetZhao avatar HaujetZhao commented on July 16, 2024

并且检查 funasr_onnx 的版本是否与 requirements-server.txt 里要求的是否一致

from capswriter-offline.

Benson722 avatar Benson722 commented on July 16, 2024

感谢您的回答!我按照 models 文件夹重新下载模型,然后重新下载符合版本的 funasr_onnx 后出现了新的问题:
(keyaudio) zhangyiqing@inin:~/CapsWriter-Offline$ python core_server.py

──────────────────────────────────────────────────────────────────────────────────────────── CapsWriter Offline Server ────────────────────────────────────────────────────────────────────────────────────────────

项目地址:https://github.com/HaujetZhao/CapsWriter-Offline

当前基文件夹:/home/zhangyiqing/CapsWriter-Offline

绑定的服务地址:0.0.0.0:6016

/home/zhangyiqing/miniconda3/envs/keyaudio/lib/python3.10/site-packages/funasr_onnx/punc_bin.py:279: FutureWarning: In the future np.bool will be defined as the corresponding NumPy scalar.
def vad_mask(self, size, vad_pos, dtype=np.bool):
Process Process-1:
Traceback (most recent call last):
File "/home/zhangyiqing/miniconda3/envs/keyaudio/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/home/zhangyiqing/miniconda3/envs/keyaudio/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/zhangyiqing/CapsWriter-Offline/util/server_init_recognizer.py", line 28, in init_recognizer
from funasr_onnx import CT_Transformer
File "/home/zhangyiqing/miniconda3/envs/keyaudio/lib/python3.10/site-packages/funasr_onnx/init.py", line 5, in
from .punc_bin import CT_Transformer
File "/home/zhangyiqing/miniconda3/envs/keyaudio/lib/python3.10/site-packages/funasr_onnx/punc_bin.py", line 166, in
class CT_Transformer_VadRealtime(CT_Transformer):
File "/home/zhangyiqing/miniconda3/envs/keyaudio/lib/python3.10/site-packages/funasr_onnx/punc_bin.py", line 279, in CT_Transformer_VadRealtime
def vad_mask(self, size, vad_pos, dtype=np.bool):
File "/home/zhangyiqing/miniconda3/envs/keyaudio/lib/python3.10/site-packages/numpy/init.py", line 324, in getattr
raise AttributeError(former_attrs[attr])
AttributeError: module 'numpy' has no attribute 'bool'.
np.bool was a deprecated alias for the builtin bool. To avoid this error in existing code, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.bool_ here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

我下载的numpy版本是1.26.3,请问是numpy版本过高吗?

from capswriter-offline.

HaujetZhao avatar HaujetZhao commented on July 16, 2024

用 1.23 或 1.24 试试

from capswriter-offline.

Benson722 avatar Benson722 commented on July 16, 2024

numpy 降低版本到 1.23.4 后,很不幸又出现了与第一次相同的问题:
(keyaudio) zhangyiqing@inin:~/CapsWriter-Offline$ python core_server.py

────────────────────────────────────────────────────────────────────────────────────────── CapsWriter Offline Server ──────────────────────────────────────────────────────────────────────────────────────────

项目地址:https://github.com/HaujetZhao/CapsWriter-Offline

当前基文件夹:/home/zhangyiqing/CapsWriter-Offline

绑定的服务地址:0.0.0.0:6016

模块加载完成

语音模型载入完成

Process Process-1:
Traceback (most recent call last):
File "/home/zhangyiqing/miniconda3/envs/keyaudio/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/home/zhangyiqing/miniconda3/envs/keyaudio/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/zhangyiqing/CapsWriter-Offline/util/server_init_recognizer.py", line 42, in init_recognizer
punc_model = CT_Transformer(ModelPaths.punc_model_dir, quantize=True)
File "/home/zhangyiqing/miniconda3/envs/keyaudio/lib/python3.10/site-packages/funasr_onnx/punc_bin.py", line 69, in init
self.ort_infer = OrtInferSession(model_file, device_id, intra_op_num_threads=intra_op_num_threads)
File "/home/zhangyiqing/miniconda3/envs/keyaudio/lib/python3.10/site-packages/funasr_onnx/utils/utils.py", line 209, in init
self.session = InferenceSession(model_file,
File "/home/zhangyiqing/miniconda3/envs/keyaudio/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 419, in init
self._create_inference_session(providers, provider_options, disabled_optimizers)
File "/home/zhangyiqing/miniconda3/envs/keyaudio/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 452, in _create_inference_session
sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model)
onnxruntime.capi.onnxruntime_pybind11_state.InvalidProtobuf: [ONNXRuntimeError] : 7 : INVALID_PROTOBUF : Load model from models/punc_ct-transformer_cn-en/model_quant.onnx failed:Protobuf parsing failed.

——————————————————
安装的依赖与 requirements-server.txt 要求是一致的

from capswriter-offline.

Benson722 avatar Benson722 commented on July 16, 2024

谢谢您的回答,core_server.py 已经可以运行了。之前的问题是:当我直接下载模型时,其中有 3 个大文件,直接使用 models 文件夹中的下载命令时,这 3 个文件不会真正下载,只会下载类似“指针”的1KB文件。我手动下载这 3 个文件后,程序可以正常运行。: )

from capswriter-offline.

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.