Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix package installation script for WHAMR! #613

Merged
merged 1 commit into from
May 2, 2022

Conversation

z-wony
Copy link
Contributor

@z-wony z-wony commented May 1, 2022

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 LCAV/pyroomacoustics#178

@z-wony z-wony changed the title Fix package install script for WHAMR! Fix package installation script for WHAMR! May 1, 2022
@mpariente
Copy link
Collaborator

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
Copy link
Contributor Author

z-wony commented May 2, 2022

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
Copy link
Collaborator

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

@z-wony
Copy link
Contributor Author

z-wony commented May 2, 2022

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
Copy link
Collaborator

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
Copy link
Contributor Author

z-wony commented May 2, 2022

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
Copy link
Collaborator

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 !

@mpariente mpariente merged commit 994660a into asteroid-team:master May 2, 2022
@ComputerCrazyCookie
Copy link

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
Copy link
Collaborator

Can you specify your versions please?

@ComputerCrazyCookie
Copy link

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
Copy link

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

@z-wony
Copy link
Contributor Author

z-wony commented Jun 6, 2022

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
Copy link

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
Copy link

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
Copy link

the compute_rir() seems not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants