Retrieval-based-Voice-Conversion-WebUI icon indicating copy to clipboard operation
Retrieval-based-Voice-Conversion-WebUI copied to clipboard

Macbook Pro M2 Pro issues with webUI Errors

Open InochiPM opened this issue 1 year ago • 11 comments

Okay so i know this might be a long shot but when trying to launch the webui from [sh run.sh] i get this error

Traceback (most recent call last):
  File "infer-web.py", line 26, in <module>
    from fairseq import checkpoint_utils
  File "/opt/homebrew/lib/python3.8/site-packages/fairseq/__init__.py", line 40, in <module>
    import fairseq.scoring  # noqa
  File "/opt/homebrew/lib/python3.8/site-packages/fairseq/scoring/__init__.py", line 55, in <module>
    importlib.import_module("fairseq.scoring." + module)
  File "/opt/homebrew/Cellar/[email protected]/3.8.18_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/opt/homebrew/lib/python3.8/site-packages/fairseq/scoring/bleu.py", line 14, in <module>
    from fairseq.scoring.tokenizer import EvaluationTokenizer
  File "/opt/homebrew/lib/python3.8/site-packages/fairseq/scoring/tokenizer.py", line 8, in <module>
    import sacrebleu as sb
  File "/opt/homebrew/lib/python3.8/site-packages/sacrebleu/__init__.py", line 21, in <module>
    from .utils import smart_open, SACREBLEU_DIR, download_test_set  # noqa: F401
  File "/opt/homebrew/lib/python3.8/site-packages/sacrebleu/utils.py", line 597, in <module>
    from .dataset import DATASETS, SUBSETS, DOMAINS, COUNTRIES
  File "/opt/homebrew/lib/python3.8/site-packages/sacrebleu/dataset/__init__.py", line 73, in <module>
    from .wmt_xml import WMTXMLDataset
  File "/opt/homebrew/lib/python3.8/site-packages/sacrebleu/dataset/wmt_xml.py", line 3, in <module>
    import lxml.etree as ET
ImportError: dlopen(/opt/homebrew/lib/python3.8/site-packages/lxml/etree.cpython-38-darwin.so, 0x0002): symbol not found in flat namespace '_exsltDateXpathCtxtRegister'

when using my Intel macbook pro it throws this error when trying to use inference.

 UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '

and when the ui works [mangio RVC] for instance i get this error,

NotImplementedError: The operator 'aten::upsample_linear1d.out' is not currently implemented for the MPS device. If you want this op to be added in priority during the prototype phase of this feature, please comment on https://github.com/pytorch/pytorch/issues/77764. As a temporary fix, you can set the environment variable `PYTORCH_ENABLE_MPS_FALLBACK=1` to use the CPU as a fallback for this op. WARNING: this will be slower than running natively on MPS.

Mind you i can get the actual UI to work on my intel macbook but i cant get it to launch on my m2 pro macbook at all. Any ideas on how to fix these issues???

InochiPM avatar Jan 31 '24 23:01 InochiPM

Traceback (most recent call last):
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/site-packages/gradio/routes.py", line 437, in run_predict
    output = await app.get_blocks().process_api(
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/site-packages/gradio/blocks.py", line 1349, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/site-packages/gradio/blocks.py", line 1283, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/site-packages/gradio/components.py", line 2586, in postprocess
    file_path = self.audio_to_temp_file(
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/site-packages/gradio/components.py", line 360, in audio_to_temp_file
    temp_dir = Path(dir) / self.hash_bytes(data.tobytes())
AttributeError: 'NoneType' object has no attribute 'tobytes'

is what i get now.

InochiPM avatar Jan 31 '24 23:01 InochiPM

IS mangio rvc ? Or rvc project you download ?

THE-SINDOL avatar Feb 03 '24 08:02 THE-SINDOL

IS mangio rvc ? Or rvc project you download ?

Its this one, RVC Project.

InochiPM avatar Feb 03 '24 16:02 InochiPM

looks like a lot of people are getting this error

jathoo avatar Feb 22 '24 16:02 jathoo

@InochiPM @InochiPM execute "export PYTORCH_ENABLE_MPS_FALLBACK=1" first then run "python infer-web.py" when you're using Macbook M series chips

iamzhangyunlu avatar Feb 25 '24 00:02 iamzhangyunlu

Hi @inochiPM thanks for the answer, could you please let me know, how you fixed the issue on M2 mac ?

I can’t even get the UI working,

I am getting this error when using run.sh

Traceback (most recent call last):
  File "infer-web.py", line 26, in <module>
    from fairseq import checkpoint_utils
  File "/opt/homebrew/lib/python3.8/site-packages/fairseq/__init__.py", line 40, in <module>
    import fairseq.scoring  # noqa
  File "/opt/homebrew/lib/python3.8/site-packages/fairseq/scoring/__init__.py", line 55, in <module>
    importlib.import_module("fairseq.scoring." + module)
  File "/opt/homebrew/Cellar/[email protected]/3.8.18_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/opt/homebrew/lib/python3.8/site-packages/fairseq/scoring/bleu.py", line 14, in <module>
    from fairseq.scoring.tokenizer import EvaluationTokenizer
  File "/opt/homebrew/lib/python3.8/site-packages/fairseq/scoring/tokenizer.py", line 8, in <module>
    import sacrebleu as sb
  File "/opt/homebrew/lib/python3.8/site-packages/sacrebleu/__init__.py", line 21, in <module>
    from .utils import smart_open, SACREBLEU_DIR, download_test_set  # noqa: F401
  File "/opt/homebrew/lib/python3.8/site-packages/sacrebleu/utils.py", line 597, in <module>
    from .dataset import DATASETS, SUBSETS, DOMAINS, COUNTRIES
  File "/opt/homebrew/lib/python3.8/site-packages/sacrebleu/dataset/__init__.py", line 73, in <module>
    from .wmt_xml import WMTXMLDataset
  File "/opt/homebrew/lib/python3.8/site-packages/sacrebleu/dataset/wmt_xml.py", line 3, in <module>
    import lxml.etree as ET
ImportError: dlopen(/opt/homebrew/lib/python3.8/site-packages/lxml/etree.cpython-38-darwin.so, 0x0002): symbol not found in flat namespace '_exsltDateXpathCtxtRegister'``

jathoo avatar Feb 25 '24 08:02 jathoo

@jathoo Had this issue, fixed it by doing this: brew install libxml2 brew install libxslt pip install lxml==4.9.2

And when you try to run don't use run.sh, do this: python infer-web.py

R3D347HR4Y avatar Feb 25 '24 16:02 R3D347HR4Y

Thanks , I did try all this steps , I can only run this command with pip3 , I guess i don’t have previous python version locally , but i am stuck with the same error.

‘’’ pip install lxml==4.9.2’’’

will it only work with pip not pip3 ?

jathoo avatar Feb 25 '24 18:02 jathoo

thanks, now I am getting this, No module named 'numpy'

I am new to Python and i wonder if there are issues with my path or something. would be helpful if someone could make a shell file to run these commands that works please

jathoo avatar Mar 01 '24 20:03 jathoo

Same issue here

hoonlight avatar Mar 07 '24 13:03 hoonlight

@jathoo, you need activate env first: ''. .venv/bin/activate'' then doing "pip install lxml==4.9.2" and ''python infer-web.py''

sxsx-G avatar Apr 22 '24 05:04 sxsx-G