sarulab-speech / UTMOS22

UT-Sarulab MOS prediction system using SSL models
MIT License
169 stars 12 forks source link

Bug when installing Fairseq on Poetry enviroment #12

Closed YaseenEltahir closed 1 year ago

YaseenEltahir commented 1 year ago

I am using Colab with python 3.8.15. always I get this error when I try to install fairseq:

Building wheels for collected packages: ffmpy, future, python-multipart, fairseq Building wheel for ffmpy (setup.py) ... done Created wheel for ffmpy: filename=ffmpy-0.3.0-py3-none-any.whl size=4693 sha256=e964fb758c4a97846c3b56538ea665fc5536d48ec6109e691aac10e255c8e542 Stored in directory: /root/.cache/pip/wheels/c7/a7/3e/a6b4408a53b4de8176071a885ed909562c2e4e9422ef7622fe Building wheel for future (setup.py) ... done Created wheel for future: filename=future-0.18.2-py3-none-any.whl size=491058 sha256=8623669d05d3d4ee11fcffd479b6f6ac05aab5781d9052cfadeb985316b2ba43 Stored in directory: /root/.cache/pip/wheels/01/49/0c/4e0a697824c7bd6516afb22e1af9d51427ccd36c74b05a297e Building wheel for python-multipart (setup.py) ... done Created wheel for python-multipart: filename=python_multipart-0.0.5-py3-none-any.whl size=31671 sha256=446c48e412d72913da9539bc0f08abb900cac1222e21526de244bf8326261785 Stored in directory: /root/.cache/pip/wheels/bf/98/35/8ff0b7838d6311008ca83f447b67df38d2d40f55aedadaf332 error: subprocess-exited-with-error

× Building wheel for fairseq (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip. Building wheel for fairseq (pyproject.toml) ... error ERROR: Failed building wheel for fairseq Successfully built ffmpy future python-multipart Failed to build fairseq ERROR: Could not build wheels for fairseq, which is required to install pyproject.toml-based projects le --inp_path /path/to/wav/file.wav --out_path /path/to/csv/file.csv 2022-11-08 06:18:29 | INFO | fairseq.tasks.text_to_speech | Please install tensorboardX: pip install tensorboardX Traceback (most recent call last): File "predict.py", line 86, in main() File "predict.py", line 54, in main assert args.inp_path.exists() AssertionError

Takaaki-Saeki commented 1 year ago

Hi, I tried the installation again but successfully installed it in my python 3.8.10 environment. Can you try to remove fairseq from .toml and manually install it using pip? If it does not work, please share the colab to reproduce the issue.

YaseenEltahir commented 1 year ago

My Colab: https://colab.research.google.com/drive/1dpHh5H65GPerFleedwFXtg8_Fi8ett7F?usp=sharing

Yes it does, but issue appears again when running (pip install -r requirements.txt) in UTMOS-demo. Like this:

Building wheels for collected packages: fairseq error: subprocess-exited-with-error

× Building wheel for fairseq (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip. Building wheel for fairseq (pyproject.toml) ... error ERROR: Failed building wheel for fairseq Failed to build fairseq ERROR: Could not build wheels for fairseq, which is required to install pyproject.toml-based projects

And predict file produces this error: Using device: cpu Traceback (most recent call last): File "predict.py", line 86, in main() File "predict.py", line 57, in main scorer = Score(ckpt_path=args.ckpt_path, input_sample_rate=sr, device=device) File "/content/UTMOS22/UTMOS-demo/score.py", line 24, in init self.model = lightning_module.BaselineLightningModule.load_from_checkpoint( File "/root/.cache/pypoetry/virtualenvs/utmos22-RnTJ09YD-py3.8/lib/python3.8/site-packages/pytorch_lightning/core/saving.py", line 139, in load_from_checkpoint checkpoint = pl_load(checkpoint_path, map_location=lambda storage, loc: storage) File "/root/.cache/pypoetry/virtualenvs/utmos22-RnTJ09YD-py3.8/lib/python3.8/site-packages/pytorch_lightning/utilities/cloud_io.py", line 47, in load return torch.load(f, map_location=map_location) File "/root/.cache/pypoetry/virtualenvs/utmos22-RnTJ09YD-py3.8/lib/python3.8/site-packages/torch/serialization.py", line 713, in load return _legacy_load(opened_file, map_location, pickle_module, pickle_load_args) File "/root/.cache/pypoetry/virtualenvs/utmos22-RnTJ09YD-py3.8/lib/python3.8/site-packages/torch/serialization.py", line 920, in _legacy_load magic_number = pickle_module.load(f, pickle_load_args) _pickle.UnpicklingError: invalid load key, 'v'.

Wataru-Nakata commented 1 year ago

UTMOS-demo uses completely different codebase. Therefore you don't need to clone https://github.com/sarulab-speech/UTMOS22 if you just want to run UTMOS-demo. I have made a colab notebook to run UTMOS-demo on google colab. please have a look. https://colab.research.google.com/drive/1y9eJZx_ujwsnzckqyNodSZZTdNocLCZ4?usp=sharing

Also, if you just wanna perform prediction, you can access our online demo. https://huggingface.co/spaces/sarulab-speech/UTMOS-demo

Hope this solves your problem

YaseenEltahir commented 1 year ago

Great, Thank you much!

Regarding the training of Strong learner, does it run as described here using Colab

https://github.com/sarulab-speech/UTMOS22/blob/master/strong/README.md

or it needs different codebase?

Wataru-Nakata commented 1 year ago

UTMOS-demo hosted on huggingface hub is only for prediction. If you want to train the model from scratch, you have to use the code on this github repo. Please note that you cannot use these 2 repository in same python enviornment as it messes up the environment. Which means, you shouldn't run poetry install and pip install -r requirements.txt in the same python environment.

Whether it runs on the google colab or not is really not our concern. But I think you can try. I hope it works!!