CorentinJ / Real-Time-Voice-Cloning

Clone a voice in 5 seconds to generate arbitrary speech in real-time
Other
51.54k stars 8.64k forks source link

Numpy error (numpy version 1.24.3) #1221

Open ehyoitsdavid opened 1 year ago

ehyoitsdavid commented 1 year ago

I am using Python 3.11.3 and NumPy 1.24.3 and I get the following error when trying to run the toolbox:

Traceback (most recent call last):
  File "C:\Users\David\code\Real-Time-Voice-Cloning\demo_toolbox.py", line 5, in <module>
    from toolbox import Toolbox
  File "C:\Users\David\code\Real-Time-Voice-Cloning\toolbox\__init__.py", line 11, in <module>
    from toolbox.ui import UI
  File "C:\Users\David\code\Real-Time-Voice-Cloning\toolbox\ui.py", line 37, in <module>
    ], dtype=np.float) / 255
             ^^^^^^^^
  File "C:\Program Files\Python311\Lib\site-packages\numpy\__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'cfloat'?
yoyo115956 commented 1 year ago

I changed it to dtype=np.float64 and it worked, try this on!

yoyo115956 commented 1 year ago

I changed it to dtype=np.float64 and it worked, try this on!

Having the same problem, then I adreesed it, too.🙈

OnlineNewsVentures commented 1 year ago

Install Python 3.7.9 then create a new VENV using 3.7 'python3.7 -m venv myenv' Install the requirements.txt and the correct version of numpy, 1.20.3 will be installed

cledybs commented 1 year ago

Keep using python 3.11.3. Then do the following: pip unsinstall numpy pip install numpy==1.23.5 This version worked for me.

theClawsmos commented 12 months ago

Hi DavidH-Tech. According to my evaluation and experience,

The error message shows that there is an issue with the usage of the np.float attribute in the code. It seems that np.float is being used as an alias for the built-in float type, but it has been deprecated in recent versions of NumPy (Meaning its been stopped in recent versions)

To resolve this error, you need to replace np.float with float in the code. The recommended fix is to use float directly instead of the deprecated alias.

Here's the modified line of code that should resolve the issue:

], dtype=float) / 255

By making this change, you will avoid the warning and ensure the compatibility with the version of NumPy you are using.

Cheers,

theClawsmos

P.S. Please note that if you specifically intended to use the NumPy scalar type, you can use np.float64 instead of np.float. However, based on the error message, it seems that using the built-in float type should be sufficient for your needs.

Lorenzo-Quart commented 11 months ago

Keep using python 3.11.3. Then do the following: pip unsinstall numpy pip install numpy==1.23.5 This version worked for me.

It worked for me too!. Thanks!

Devispro45 commented 10 months ago

what file do i change the line in ], dtype=float) / 255

ksnakulan commented 4 months ago

pip install numpy==1.22.0 worked for me