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

TypeError: Expected maxsize to be an integer or None #1016

Closed
Adibian opened this issue Oct 13, 2021 · 3 comments
Closed

TypeError: Expected maxsize to be an integer or None #1016

Adibian opened this issue Oct 13, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@Adibian
Copy link

Adibian commented Oct 13, 2021

I tried to train FastPitch in google colab and I followed the Quick Start Guide and after downloading the LJSpeech-1.1 dataset when executing the following command:
bash scripts/prepare_dataset.sh

I get the this error:

Processing filelists/ljs_audio_text.txt...
Traceback (most recent call last):
  File "prepare_dataset.py", line 174, in <module>
    main()
  File "prepare_dataset.py", line 129, in main
    pitch_online_method=args.f0_method)
  File "/content/DeepLearningExamples/PyTorch/SpeechSynthesis/FastPitch/fastpitch/data_function.py", line 190, in __init__
    self.betabinomial_interpolator = BetaBinomialInterpolator()
  File "/content/DeepLearningExamples/PyTorch/SpeechSynthesis/FastPitch/fastpitch/data_function.py", line 54, in __init__
    self.bank = functools.lru_cache(beta_binomial_prior_distribution)
  File "/usr/lib/python3.7/functools.py", line 490, in lru_cache
    raise TypeError('Expected maxsize to be an integer or None')
TypeError: Expected maxsize to be an integer or None
@Adibian Adibian added the bug Something isn't working label Oct 13, 2021
@alancucki
Copy link
Contributor

Hi @majidAdibian77 ,

thanks for reporting this bug!
You're using Python <= 3.7, in Python 3.8+ lru_cache has gotten user_function argument, which is used in FastPitch code.

In the Quick Start Guide, we recommend the setup that we support using NGC containers, which come with up-to-date Python.

@Adibian
Copy link
Author

Adibian commented Oct 21, 2021

Hi @alancucki
Thanks for your answer.
Yes, you are right.
Also I could solve this problem without updating python.
I replaced following line in fastpitch/data_function.py/BetaBinomialInterpolator class/__init__ function (this line):
self.bank = functools.lru_cache(beta_binomial_prior_distribution)

with two new lines:

f = functools.lru_cache(maxsize=128)
self.bank = f(beta_binomial_prior_distribution)

and then this error was gone :)

@DarkIndoraptor
Copy link

One question, does this also work with lutris?

thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 23, 2023
thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 25, 2023
thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 25, 2023
thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 25, 2023
thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 25, 2023
thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 25, 2023
thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 28, 2023
thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 28, 2023
thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 28, 2023
thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 28, 2023
thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 28, 2023
thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 29, 2023
thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 29, 2023
thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 29, 2023
thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 29, 2023
thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 29, 2023
thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 29, 2023
thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 30, 2023
thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 30, 2023
thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 30, 2023
thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 30, 2023
thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 31, 2023
thibaultcha added a commit to Kong/ngx_wasm_module that referenced this issue Oct 31, 2023
curiositycasualty pushed a commit to Kong/ngx_wasm_module that referenced this issue Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants