Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API サーバーが立ち上がらない (Ubuntu) #168

Open
ku6ryo opened this issue Oct 4, 2024 · 4 comments
Open

API サーバーが立ち上がらない (Ubuntu) #168

ku6ryo opened this issue Oct 4, 2024 · 4 comments

Comments

@ku6ryo
Copy link

ku6ryo commented Oct 4, 2024

Runpod のクラウドサーバー (Ubuntu) で API サーバーを立ち上げようとしたところ、以下のエラーがでて立ち上がりませんでした。原因・解決方法がわかれば教えていただきたいです。

(new_env) root@7353202850ee:/workspace/Style-Bert-VITS2# python server_fastapi.py
10-04 19:13:30 | DEBUG  | __init__.py:130 | pyopenjtalk worker server started
Error: Failed to update dictionary.
Traceback (most recent call last):
  File "/workspace/Style-Bert-VITS2/style_bert_vits2/nlp/japanese/user_dict/__init__.py", line 145, in update_dict
    pyopenjtalk.mecab_dict_index(str(tmp_csv_path), str(tmp_compiled_path))
  File "/workspace/Style-Bert-VITS2/style_bert_vits2/nlp/japanese/pyopenjtalk_worker/__init__.py", line 46, in mecab_dict_index
    WORKER_CLIENT.dispatch_pyopenjtalk("mecab_dict_index", path, out_path, dn_mecab)
  File "/workspace/Style-Bert-VITS2/style_bert_vits2/nlp/japanese/pyopenjtalk_worker/worker_client.py", line 41, in dispatch_pyopenjtalk
    response = receive_data(self.sock)
  File "/workspace/Style-Bert-VITS2/style_bert_vits2/nlp/japanese/pyopenjtalk_worker/worker_common.py", line 44, in receive_data
    body = __receive_until(sock, data_length)
  File "/workspace/Style-Bert-VITS2/style_bert_vits2/nlp/japanese/pyopenjtalk_worker/worker_common.py", line 35, in __receive_until
    raise ConnectionClosedException("接続が閉じられました")
style_bert_vits2.nlp.japanese.pyopenjtalk_worker.worker_common.ConnectionClosedException: 接続が閉じられました
Traceback (most recent call last):
  File "/workspace/Style-Bert-VITS2/server_fastapi.py", line 52, in <module>
    update_dict()
  File "/workspace/Style-Bert-VITS2/style_bert_vits2/nlp/japanese/user_dict/__init__.py", line 159, in update_dict
    raise e
  File "/workspace/Style-Bert-VITS2/style_bert_vits2/nlp/japanese/user_dict/__init__.py", line 145, in update_dict
    pyopenjtalk.mecab_dict_index(str(tmp_csv_path), str(tmp_compiled_path))
  File "/workspace/Style-Bert-VITS2/style_bert_vits2/nlp/japanese/pyopenjtalk_worker/__init__.py", line 46, in mecab_dict_index
    WORKER_CLIENT.dispatch_pyopenjtalk("mecab_dict_index", path, out_path, dn_mecab)
  File "/workspace/Style-Bert-VITS2/style_bert_vits2/nlp/japanese/pyopenjtalk_worker/worker_client.py", line 41, in dispatch_pyopenjtalk
    response = receive_data(self.sock)
  File "/workspace/Style-Bert-VITS2/style_bert_vits2/nlp/japanese/pyopenjtalk_worker/worker_common.py", line 44, in receive_data
    body = __receive_until(sock, data_length)
  File "/workspace/Style-Bert-VITS2/style_bert_vits2/nlp/japanese/pyopenjtalk_worker/worker_common.py", line 35, in __receive_until
    raise ConnectionClosedException("接続が閉じられました")
style_bert_vits2.nlp.japanese.pyopenjtalk_worker.worker_common.ConnectionClosedException: 接続が閉じられました
10-04 19:13:30 | DEBUG  | __init__.py:147 | pyopenjtalk worker server terminated
10-04 19:13:30 | ERROR  | __init__.py:157 | 接続が閉じられました
@luvwinnie
Copy link

luvwinnie commented Oct 14, 2024

@litagin02 さん,こんにちは。

私も同じ問題が発生しています。

私の方もローカルのリモートのUbuntuでやろうとしていますが,うまく,pyopenjtalkが立ち上がりません。
PyopenJTalkのWorkerClientが,リモートでやる場合,どうデバッグすればよいでしょうか?
多分,TCPサーバーがうまく立ち上がれていない気がします。

@luvwinnie
Copy link

luvwinnie commented Oct 14, 2024

@litagin02 どうやら,きちんと@litagin02さんのpyopenjtalkを使わないと動かないらしいです。

Error: Failed to update dictionary.
Traceback (most recent call last):
  File "/misc/Work34/cheesiang_leow/tts/Style-Bert-VITS2/style_bert_vits2/nlp/japanese/user_dict/__init__.py", line 150, in update_dict
    pyopenjtalk.unset_user_dict()
  File "/misc/Work34/cheesiang_leow/tts/Style-Bert-VITS2/style_bert_vits2/nlp/japanese/pyopenjtalk_worker/__init__.py", line 72, in unset_user_dict
    pyopenjtalk.unset_user_dict()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pyopenjtalk' has no attribute 'unset_user_dict'
Traceback (most recent call last):
  File "/misc/Work34/cheesiang_leow/tts/Style-Bert-VITS2/server_editor.py", line 157, in <module>
    update_dict()
  File "/misc/Work34/cheesiang_leow/tts/Style-Bert-VITS2/style_bert_vits2/nlp/japanese/user_dict/__init__.py", line 159, in update_dict
    raise e
  File "/misc/Work34/cheesiang_leow/tts/Style-Bert-VITS2/style_bert_vits2/nlp/japanese/user_dict/__init__.py", line 150, in update_dict
    pyopenjtalk.unset_user_dict()
  File "/misc/Work34/cheesiang_leow/tts/Style-Bert-VITS2/style_bert_vits2/nlp/japanese/pyopenjtalk_worker/__init__.py", line 72, in unset_user_dict
    pyopenjtalk.unset_user_dict()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pyopenjtalk' has no attribute 'unset_user_dict'

今後READMEに追加したほうが良いと思います。

@sabipipe
Copy link

こちら再現しました。requirements.txt を以下のように書き換えて pip install -r requirements.txt し、pyopenjtalkのGitHub上の最新版を使わせるようにすると動きました。リリース漏れでしょうか。Windowsでは問題ないのが不思議ですが。

-pyopenjtalk-dict
+-e git+https://github.com/litagin02/pyopenjtalk.git#egg=pyopenjtalk-dict

@junmoka
Copy link

junmoka commented Nov 25, 2024

runpodで同様の事象が発生しました。

runpod環境で稼働しているサービスと、worker_serverのポートが競合していることが原因だと思われます。
WORKER_PORTを「9999」など競合しないポートに変更したところ正常に動作しました。

worker_serverのポート

style_bert_vits2/nlp/japanese/pyopenjtalk_worker/init.py

from style_bert_vits2.nlp.japanese.pyopenjtalk_worker.worker_common import WORKER_PORT

style_bert_vits2/nlp/japanese/pyopenjtalk_worker/worker_common.py

WORKER_PORT: Final[int] = 7861

runpodの稼働ポート

# lsof -i:7861
COMMAND PID USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
nginx    52 root    8u  IPv4 21037148      0t0  TCP *:7861 (LISTEN)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants