asteroid-team / asteroid

The PyTorch-based audio source separation toolkit for researchers
https://asteroid-team.github.io/
MIT License
2.22k stars 422 forks source link

Fix package installation script for WHAMR! #613

Closed z-wony closed 2 years ago

z-wony commented 2 years ago

By the pyroomacoustics package's API deprecation, WHAMR! script not working with latest version of pyroomacoustics. So, we should install specific version using requirements.txt in whamr_scripts.

The issue had discussed at https://github.com/LCAV/pyroomacoustics/issues/178

mpariente commented 2 years ago

Thanks for the PR ! Does this really solve the problem ?

Shouldn't we rather install pyroomacoustics with a fixed version, or a maximum version ?

z-wony commented 2 years ago

Thanks for the PR ! Does this really solve the problem ?

Yes, first I tried to fix WHAMR!'s code for working with pyroomacoustics 0.4.1. But that made more powerful room impulse. So, when I downgrade pyroomacoustics version (0.3.1), it works exactly.

Shouldn't we rather install pyroomacoustics with a fixed version, or a maximum version ?

In the WHAMR!'s requirements.txt file, the fixed versions are specified. Likes below

pyroomacoustics==0.3.1
SoundFile==0.10.3.post1
pandas==1.1.2
scipy==1.5.2
numpy==1.19.1
pyloudnorm==0.1.0
mpariente commented 2 years ago

But where is this requirement file ? I don't see it in the recipe here, right?

z-wony commented 2 years ago

Download script are located at line 13 in same file. https://github.com/asteroid-team/asteroid/blob/master/egs/whamr/TasNet/local/prepare_data.sh#L13

wget -c --tries=0 --read-timeout=20 https://storage.googleapis.com/whisper-public/wham_noise.zip -P $out_dir

The download scripts are disabled (commented), I guess because it just be needed at first time to setup WHAMR! dataset.

mpariente commented 2 years ago

I don't have the impression that it is downloaded in the recipe folder, but in $out_dir.

Did you run the script from scratch to make sure it works ?

z-wony commented 2 years ago

I don't have the impression that it is downloaded in the recipe folder, but in $out_dir.

Did you run the script from scratch to make sure it works ?

I'm so sorrrrrrrry, I confused. Upper code (the line 13..) is for WHAM dataset. Not WHAMR!. : (

The WHAMR! scripts are download by line 17 (prepare_data.sh#L17)

I test below steps.

  1. Download wsj0 dataset
  2. Set "sphere_dir, wsj0_wav_dir, whamr_wav_dir" variables in egs/whamr/TasNet/run.sh
  3. Active line 12~25 in egs/whamr/TasNet/local/prepare_data.sh
  4. Run egs/whamr/TasNet/run.sh
  5. Wait 1 day
mpariente commented 2 years ago

It's me who got confused, I didn't pay attention to this line which makes your code work, sorry about that and thanks again for the fix !

ComputerCrazyCookie commented 2 years ago

Hey guys, i am also trying to download and build the WHAMR package but even when installing via requirements-file, i get the error message: RuntimeError: module compiled against API version 0xf but this version of numpy is 0xd C-extension libroom unavailable. Falling back to pure python C-extension libroom unavailable. Falling back to pure python Traceback (most recent call last): File "create_wham_from_scratch.py", line 167, in create_wham(args.wsj0_root, args.wham_noise_root, args.output_dir) File "create_wham_from_scratch.py", line 71, in create_wham room.generate_rirs() File "/home/joschi/Downloads/Data/wham_noise/whamr_scripts/wham_room.py", line 52, in generate_rirs self.compute_rir() File "/home/joschi/Downloads/Data/wham_noise/whamr_scripts/wham_room.py", line 44, in compute_rir h.append(source.get_rir(mic, self.visibility[s][m], self.fs, self.t0)[:self.max_rir_len]) File "/home/joschi/Dokumente/espnet-master/tools/anaconda/envs/myenv/lib/python3.8/site-packages/pyroomacoustics/soundsource.py", line 233, in get_rir fast_rir_builder(ir, time, alpha, visibility, Fs, fdl) File "pyroomacoustics/build_rir.pyx", line 14, in pyroomacoustics.build_rir.fast_rir_builder ValueError: Buffer dtype mismatch, expected 'int' but got 'bool' Do you have any tips? The installation process was successful

mpariente commented 2 years ago

Can you specify your versions please?

ComputerCrazyCookie commented 2 years ago

OS: Distributor ID: Ubuntu Description: Ubuntu 22.04 LTS Release: 22.04

python --> 3.8.13 pandas --> 1.1.2 scipy --> 1.5.2 pyloudnorm --> 0.1.0 numpy --> 1.19.1 Soundfile --> 0.10.3.post1 pyroomacoustics --> 0.3.1 Cython --> 0.29.30 cffi --> 1.15.0 future --> 0.18.2 python-dateutil --> 2.8.2 pytz --> 2022.1 pycparser --> 2.21 six --> 1.16.0

Thanks in Advance!

ComputerCrazyCookie commented 2 years ago

When i used the python 3.10, it was not able to build the wheels for the numpy (1.19.1)

z-wony commented 2 years ago

I'm sorry for not being help.

In my case, all package versions are same with you except Ubuntu version (My version is 20.04) I'd like to suggest re-install numpy, Cython, pyroomacoustics, but I don't make sure it's solution. Install as order to numpy -> requirements.txt.

pip install numpy==1.19.1
pip install -r <requirements.txt>
ComputerCrazyCookie commented 2 years ago

You are a huge help, it seems to work (--> Last message: completed 500 of 20000 utterances)! I am so relieved. Thank you so so much, my friend!

I tried reinstalling pyroomacoustics (like you said) and the versions slightly changed to:

Cython-0.29.30 numpy-1.22.4 (new) pyroomacoustics-0.3.1 scipy-1.8.1 (new)

kukli-kuli commented 5 months ago

Hello, there was a problem when I run create_wham_from_scratch.py, I use pyroomacoustics 0.3.1 and no errors reported, but it doesn't work. No data created but folder. I have downloaded wsj0, wham_noise and given the path.

kukli-kuli commented 5 months ago

the compute_rir() seems not work