Coder Social home page Coder Social logo

Wrong Numpy Version - error about sadtalker HOT 9 OPEN

SirDuffy avatar SirDuffy commented on June 3, 2024 1
Wrong Numpy Version - error

from sadtalker.

Comments (9)

fnabbo avatar fnabbo commented on June 3, 2024 3

Hi, my sad talker version does not run anymore. The error message says that the numpy version is wrong. How can i repair this?
image

I have the same issue, it comes from the following section of code :

def calculate_points(heatmaps):
    # change heatmaps to landmarks
    B, N, H, W = heatmaps.shape
    HW = H * W
    BN_range = np.arange(B * N)

    heatline = heatmaps.reshape(B, N, HW)
    indexes = np.argmax(heatline, axis=2)

    preds = np.stack((indexes % W, indexes // W), axis=2)
    preds = preds.astype(np.float, copy=False) <--- this line

    inr = indexes.ravel()

in the file src/face3d/util/my_awing_arch.py

I tried to convert it to normal python float and it went away, but now I still have this error : File "C:\Users\stable-diffusion-webui/extensions/SadTalker\src\face3d\util\preprocess.py", line 101, in align_img trans_params = np.array([w0, h0, s, t[0], t[1]]) ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (5,) + inhomogeneous part.

Here is my config : image

NOTE : I had a similar issue before with the librosa library, but it was with the np.comlex, it was similar to this one with np.float, so I changed it from the source code of the librosa library ( from np.complex to complex ).

I had the exact same issue and was stuck at the same error. After a little research i figured its because the array contains int and float and therefor throws that error. Explcitly specifying that it can take an object fixed it:

In file src\face3d\util\preprocessor.py line 101 I replaced trans_params = np.array([w0, h0, s, t[0], t[1]]) with trans_params = np.array([w0, h0, s, t[0], t[1]], dtype=object)

(I also had to fix the np.complex and np.float issue before this)

from sadtalker.

ayoubachak avatar ayoubachak commented on June 3, 2024 2

Hi, my sad talker version does not run anymore. The error message says that the numpy version is wrong. How can i repair this?
image

I have the same issue, it comes from the following section of code :

def calculate_points(heatmaps):
    # change heatmaps to landmarks
    B, N, H, W = heatmaps.shape
    HW = H * W
    BN_range = np.arange(B * N)

    heatline = heatmaps.reshape(B, N, HW)
    indexes = np.argmax(heatline, axis=2)

    preds = np.stack((indexes % W, indexes // W), axis=2)
    preds = preds.astype(np.float, copy=False) <--- this line

    inr = indexes.ravel()

in the file src/face3d/util/my_awing_arch.py

I tried to convert it to normal python float and it went away, but now I still have this error : File "C:\Users\stable-diffusion-webui/extensions/SadTalker\src\face3d\util\preprocess.py", line 101, in align_img trans_params = np.array([w0, h0, s, t[0], t[1]]) ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (5,) + inhomogeneous part.

Here is my config : image

NOTE : I had a similar issue before with the librosa library, but it was with the np.comlex, it was similar to this one with np.float, so I changed it from the source code of the librosa library ( from np.complex to complex ).

I had the exact same issue and was stuck at the same error. After a little research i figured its because the array contains int and float and therefor throws that error. Explcitly specifying that it can take an object fixed it:

In file src\face3d\util\preprocessor.py line 101 I replaced trans_params = np.array([w0, h0, s, t[0], t[1]]) with trans_params = np.array([w0, h0, s, t[0], t[1]], dtype=object)

(I also had to fix the np.complex and np.float issue before this)

It worked perfectly, thanks G.

from sadtalker.

oisilener1982 avatar oisilener1982 commented on June 3, 2024

same problem if i use 1.8

from sadtalker.

Zhjhp2020 avatar Zhjhp2020 commented on June 3, 2024

微信图片_20240321114541
me too

from sadtalker.

oisilener1982 avatar oisilener1982 commented on June 3, 2024

IF the devs are only active this would have been an easy job to fix

from sadtalker.

dthcle avatar dthcle commented on June 3, 2024

try use "cfloat"?

from sadtalker.

Nate82 avatar Nate82 commented on June 3, 2024

try use "cfloat"?

Can you go into more detail? Should we change the code somewhere?

from sadtalker.

ayoubachak avatar ayoubachak commented on June 3, 2024

Hi, my sad talker version does not run anymore. The error message says that the numpy version is wrong. How can i repair this?

image

I have the same issue, it comes from the following section of code :

def calculate_points(heatmaps):
    # change heatmaps to landmarks
    B, N, H, W = heatmaps.shape
    HW = H * W
    BN_range = np.arange(B * N)

    heatline = heatmaps.reshape(B, N, HW)
    indexes = np.argmax(heatline, axis=2)

    preds = np.stack((indexes % W, indexes // W), axis=2)
    preds = preds.astype(np.float, copy=False) <--- this line

    inr = indexes.ravel()

in the file src/face3d/util/my_awing_arch.py

I tried to convert it to normal python float and it went away, but now I still have this error :
File "C:\Users\stable-diffusion-webui/extensions/SadTalker\src\face3d\util\preprocess.py", line 101, in align_img
trans_params = np.array([w0, h0, s, t[0], t[1]])
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (5,) + inhomogeneous part.

Here is my config :
image

NOTE :
I had a similar issue before with the librosa library, but it was with the np.comlex, it was similar to this one with np.float, so I changed it from the source code of the librosa library ( from np.complex to complex ).

from sadtalker.

AppStolz avatar AppStolz commented on June 3, 2024

Take a look here at a solution that works 100%
#822 (comment)

from sadtalker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.