fairseq2
fairseq2 copied to clipboard
OSError: fairseq2 requires libsndfile. Since you are in a Conda environment, use `conda install -c conda-forge libsndfile==1.0.31` to install it.
Hi, I have an error when try to run tutorial of end_to_end_fine_tuning.
The commend I am running:
fairseq2 lm instruction_finetune $OUTPUT_DIR --config-file configs/sft.yaml
The error message is below:
Traceback (most recent call last):
File "/home/yu/projects/RLHF/rlhf/bin/fairseq2", line 5, in <module>
from fairseq2.cli import main
File "/home/yu/projects/RLHF/rlhf/lib/python3.10/site-packages/fairseq2/__init__.py", line 11, in <module>
import fairseq2n # Report any fairseq2n initialization error eagerly.
File "/home/yu/projects/RLHF/rlhf/lib/python3.10/site-packages/fairseq2n/__init__.py", line 169, in <module>
_load_shared_libraries()
File "/home/yu/projects/RLHF/rlhf/lib/python3.10/site-packages/fairseq2n/__init__.py", line 88, in _load_shared_libraries
_load_sndfile()
File "/home/yu/projects/RLHF/rlhf/lib/python3.10/site-packages/fairseq2n/__init__.py", line 115, in _load_sndfile
raise OSError(
OSError: fairseq2 requires libsndfile. Since you are in a Conda environment, use `conda install -c conda-forge libsndfile==1.0.31` to install it.
I installed the libsndfile through:
sudo apt install libsndfile1
And installed the pytorch and fairseq2 in a venv environment through:
pip3 install torch torchvision torchaudio
pip install fairseq2\
--extra-index-url https://fair.pkg.atmeta.com/fairseq2/whl/pt2.6.0/cu124
Following issue #10, I disabled conda by comment out related code in ~/.bashrc:
## >>> conda initialize >>>
## !! Contents within this block are managed by 'conda init' !!
#__conda_setup="$('/home/yu/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
#if [ $? -eq 0 ]; then
# eval "$__conda_setup"
#else
# if [ -f "/home/yu/anaconda3/etc/profile.d/conda.sh" ]; then
# . "/home/yu/anaconda3/etc/profile.d/conda.sh"
# else
# export PATH="/home/yu/anaconda3/bin:$PATH"
# fi
#fi
#unset __conda_setup
## <<< conda initialize <<<
But it does not work for me, and I still face this error.
Same error in miniconda OSX, python versions 3.10, 3.11 and 3.12.
ln -s /usr/lib/x86_64-linux-gnu/libsndfile.so.1 /usr/lib/x86_64-linux-gnu/libsndfile.so works for me on Linux.