AttributeError: module 'numpy' has no attribute 'complex' #1

Open
opened 2023-06-08 19:18:40 +00:00 by Milor123 · 1 comment

Hi guys, i am trying runing it in windows 11 with directml, i have a AMD GPU rx6700xt

use the same python version 3.9 that you linked in the description

(tortoise-venv) C:\Users\NoeXVanitasXJunk\tortoise-tts>python main.py
Traceback (most recent call last):
  File "C:\Users\NoeXVanitasXJunk\tortoise-tts\main.py", line 1, in <module>
    import webui as mrq
  File "C:\Users\NoeXVanitasXJunk\tortoise-tts\webui.py", line 17, in <module>
    import tortoise.api
  File "C:\Users\NoeXVanitasXJunk\tortoise-tts\tortoise\api.py", line 30, in <module>
    from tortoise.utils.audio import wav_to_univnet_mel, denormalize_tacotron_mel
  File "C:\Users\NoeXVanitasXJunk\tortoise-tts\tortoise\utils\audio.py", line 4, in <module>
    import librosa
  File "C:\Users\NoeXVanitasXJunk\tortoise-tts\tortoise-venv\lib\site-packages\librosa\__init__.py", line 211, in <module>
    from . import core
  File "C:\Users\NoeXVanitasXJunk\tortoise-tts\tortoise-venv\lib\site-packages\librosa\core\__init__.py", line 9, in <module>
    from .constantq import *  # pylint: disable=wildcard-import
  File "C:\Users\NoeXVanitasXJunk\tortoise-tts\tortoise-venv\lib\site-packages\librosa\core\constantq.py", line 1059, in <module>
    dtype=np.complex,
  File "C:\Users\NoeXVanitasXJunk\tortoise-tts\tortoise-venv\lib\site-packages\numpy\__init__.py", line 284, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'complex' 

my python version:

(tortoise-venv) C:\Users\NoeXVanitasXJunk\tortoise-tts> python --version
Python 3.9.13

Hi guys, i am trying runing it in windows 11 with directml, i have a AMD GPU rx6700xt use the same python version 3.9 that you linked in the description ``` (tortoise-venv) C:\Users\NoeXVanitasXJunk\tortoise-tts>python main.py Traceback (most recent call last): File "C:\Users\NoeXVanitasXJunk\tortoise-tts\main.py", line 1, in <module> import webui as mrq File "C:\Users\NoeXVanitasXJunk\tortoise-tts\webui.py", line 17, in <module> import tortoise.api File "C:\Users\NoeXVanitasXJunk\tortoise-tts\tortoise\api.py", line 30, in <module> from tortoise.utils.audio import wav_to_univnet_mel, denormalize_tacotron_mel File "C:\Users\NoeXVanitasXJunk\tortoise-tts\tortoise\utils\audio.py", line 4, in <module> import librosa File "C:\Users\NoeXVanitasXJunk\tortoise-tts\tortoise-venv\lib\site-packages\librosa\__init__.py", line 211, in <module> from . import core File "C:\Users\NoeXVanitasXJunk\tortoise-tts\tortoise-venv\lib\site-packages\librosa\core\__init__.py", line 9, in <module> from .constantq import * # pylint: disable=wildcard-import File "C:\Users\NoeXVanitasXJunk\tortoise-tts\tortoise-venv\lib\site-packages\librosa\core\constantq.py", line 1059, in <module> dtype=np.complex, File "C:\Users\NoeXVanitasXJunk\tortoise-tts\tortoise-venv\lib\site-packages\numpy\__init__.py", line 284, in __getattr__ raise AttributeError("module {!r} has no attribute " AttributeError: module 'numpy' has no attribute 'complex' ``` my python version: > (tortoise-venv) C:\Users\NoeXVanitasXJunk\tortoise-tts> python --version Python 3.9.13

I am on Linux but i had the same issue. The problem is that the NumPy version was updated and np.complex is deprecated. So just ad the older version into the requirement.txt like this:

  1. open the requirements.txt in the tortoise folder with an editor of your choice
  2. change the line
    numpy
    to
    numpy==1.21.5

If you encounter afterwards an error like:
./start.sh Traceback (most recent call last): File "/export/data/progz/tortoise_tts/tortoise-tts/./main.py", line 10, in <module> mrq.webui = mrq.setup_gradio() File "/export/data/progz/tortoise_tts/tortoise-tts/webui.py", line 570, in setup_gradio gradio.utils.version_check = noop(gradio.utils.version_check) AttributeError: module 'gradio.utils' has no attribute 'version_check'

Then go into webui.py at line ~570 and remove the lines:

gradio.utils.version_check = noop(gradio.utils.version_check)
gradio.utils.initiated_analytics = noop(gradio.utils.initiated_analytics)
gradio.utils.launch_analytics = noop(gradio.utils.launch_analytics)
gradio.utils.integration_analytics = noop(gradio.utils.integration_analytics)
gradio.utils.error_analytics = noop(gradio.utils.error_analytics)
gradio.utils.log_feature_analytics = noop(gradio.utils.log_feature_analytics)`

and add this instead:

gradio.utils.version_check = lambda: None
gradio.utils.get_local_ip_address = lambda: '127.0.0.1'

Hope this helps.

I am on Linux but i had the same issue. The problem is that the NumPy version was updated and np.complex is deprecated. So just ad the older version into the requirement.txt like this: 1. open the requirements.txt in the tortoise folder with an editor of your choice 2. change the line `numpy` to `numpy==1.21.5` If you encounter afterwards an error like: `./start.sh Traceback (most recent call last): File "/export/data/progz/tortoise_tts/tortoise-tts/./main.py", line 10, in <module> mrq.webui = mrq.setup_gradio() File "/export/data/progz/tortoise_tts/tortoise-tts/webui.py", line 570, in setup_gradio gradio.utils.version_check = noop(gradio.utils.version_check) AttributeError: module 'gradio.utils' has no attribute 'version_check'` Then go into webui.py at line ~570 and remove the lines: > gradio.utils.version_check = noop(gradio.utils.version_check) > gradio.utils.initiated_analytics = noop(gradio.utils.initiated_analytics) > gradio.utils.launch_analytics = noop(gradio.utils.launch_analytics) > gradio.utils.integration_analytics = noop(gradio.utils.integration_analytics) > gradio.utils.error_analytics = noop(gradio.utils.error_analytics) > gradio.utils.log_feature_analytics = noop(gradio.utils.log_feature_analytics)` and add this instead: > gradio.utils.version_check = lambda: None > gradio.utils.get_local_ip_address = lambda: '127.0.0.1' Hope this helps.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lightmare/tortoise-tts#1
No description provided.