w-okada / voice-changer

リアルタイムボイスチェンジャー Realtime Voice Changer
Other
15.34k stars 1.65k forks source link

AttributeError: module 'sys' has no attribute '_MEIPASS' #1044

Open lennondong opened 6 months ago

lennondong commented 6 months ago

Today I run the code according to the the doc as followed.

https://github.com/w-okada/voice-changer/blob/0f0225cfcdc62ddf41495124cc9a5cef53c5f014/README_dev_en.md

There's an error in the last step ---- run server.

python3 MMVCServerSIO.py -p 18888 --https true \ --content_vec_500 pretrain/checkpoint_best_legacy_500.pt \ --content_vec_500_onnx pretrain/content_vec_500.onnx \ --content_vec_500_onnx_on true \ --hubert_base pretrain/hubert_base.pt \ --hubert_base_jp pretrain/rinna_hubert_base_jp.pt \ --hubert_soft pretrain/hubert/hubert-soft-0d54a1f4.pt \ --nsf_hifigan pretrain/nsf_hifigan/model \ --crepe_onnx_full pretrain/crepe_onnx_full.onnx \ --crepe_onnx_tiny pretrain/crepe_onnx_tiny.onnx \ --rmvpe pretrain/rmvpe.pt \ --model_dir model_dir \ --samples samples.json


Booting PHASE :__main__
PYTHON:3.10.13 (main, Sep 11 2023, 08:16:02) [Clang 14.0.6 ]
Activating the Voice Changer.

[Voice Changer] download sample catalog. samples_0004_t.json [Voice Changer] download sample catalog. samples_0004_o.json [Voice Changer] download sample catalog. samples_0004_d.json [Voice Changer] model_dir is already exists. skip download samples. Internal_Port:18888 protocol: HTTPS(self-signed), key:keys/20231217_143449.key, cert:keys/20231217_143449.cert


Please open the following URL in your browser.
https://<IP>:<PORT>/
In many cases, it will launch when you access any of the following URLs.
https://127.0.0.1:18888/
https://10.2.2.24:18888/
Booting PHASE :__mp_main__
The server process is starting up.
Booting PHASE :MMVCServerSIO

[Voice Changer] VoiceChangerManager initializing... [Voice Changer] VoiceChangerManager initializing... done. [Voice Changer] MMVC_Rest initializing... Process SpawnProcess-1: Traceback (most recent call last): File "/Users/donny/miniconda3/envs/env310/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/Users/donny/miniconda3/envs/env310/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, self._kwargs) File "/Users/donny/miniconda3/envs/env310/lib/python3.10/site-packages/uvicorn/_subprocess.py", line 76, in subprocess_started target(sockets=sockets) File "/Users/donny/miniconda3/envs/env310/lib/python3.10/site-packages/uvicorn/server.py", line 59, in run return asyncio.run(self.serve(sockets=sockets)) File "/Users/donny/miniconda3/envs/env310/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/Users/donny/miniconda3/envs/env310/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete return future.result() File "/Users/donny/miniconda3/envs/env310/lib/python3.10/site-packages/uvicorn/server.py", line 66, in serve config.load() File "/Users/donny/miniconda3/envs/env310/lib/python3.10/site-packages/uvicorn/config.py", line 471, in load self.loaded_app = import_from_string(self.app) File "/Users/donny/miniconda3/envs/env310/lib/python3.10/site-packages/uvicorn/importer.py", line 21, in import_from_string module = importlib.import_module(module_str) File "/Users/donny/miniconda3/envs/env310/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/Volumes/ZhiTai/AI/Voice Changer/voice-changer-master/server/MMVCServerSIO.py", line 135, in app_fastapi = MMVC_Rest.get_instance(voiceChangerManager, voiceChangerParams) File "/Volumes/ZhiTai/AI/Voice Changer/voice-changer-master/server/restapi/MMVC_Rest.py", line 84, in get_instance p1 = os.path.dirname(sys._MEIPASS) AttributeError: module 'sys' has no attribute '_MEIPASS'**

lennondong commented 6 months ago

@w-okada I need your help.

lennondong commented 6 months ago

I find another post and modify the code like this. And now the webui run and open the webui.

(2) server/restapi/MMVC_Rest.py replace if sys.platform.startswith("darwin"): to if sys.platform.startswith("darwin") and hasattr(sys, "_MEIPASS"):

Now there's a new info:

/Users/donny/miniconda3/envs/env310/lib/python3.10/site-packages/torch/nn/utils/weight_norm.py:25: UserWarning: The operator 'aten::_weight_norm_interface' is not currently supported on the MPS backend and will fall back to run on the CPU. This may have performance implications. (Triggered internally at /Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/mps/MPSFallback.mm:11.)

The converted sound is awful,just some noises.

[Uploading output.mp3.zip…]()

lennondong commented 6 months ago

Finally, I have to say that I have tried all the ways to run this program, but they all failed to run well on my mac.