SadTalker icon indicating copy to clipboard operation
SadTalker copied to clipboard

Wrong Numpy Version - error

Open SirDuffy opened this issue 1 year ago • 9 comments

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

SirDuffy avatar Mar 19 '24 20:03 SirDuffy

same problem if i use 1.8

oisilener1982 avatar Mar 21 '24 02:03 oisilener1982

微信图片_20240321114541 me too

Zhjhp2020 avatar Mar 21 '24 03:03 Zhjhp2020

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

oisilener1982 avatar Mar 21 '24 04:03 oisilener1982

try use "cfloat"?

dthcle avatar Mar 27 '24 08:03 dthcle

try use "cfloat"?

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

Nate82 avatar Mar 30 '24 09:03 Nate82

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 ).

ayoubachak avatar Mar 31 '24 15:03 ayoubachak

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)

fnabbo avatar Mar 31 '24 20:03 fnabbo

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.

ayoubachak avatar Mar 31 '24 21:03 ayoubachak

Take a look here at a solution that works 100% https://github.com/OpenTalker/SadTalker/issues/822#issuecomment-2053857698

AppStolz avatar Apr 14 '24 02:04 AppStolz