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

Error on vladmandic/automatic #306

Open
ShmuelRonen opened this issue May 19, 2023 · 6 comments
Open

Error on vladmandic/automatic #306

ShmuelRonen opened this issue May 19, 2023 · 6 comments

Comments

@ShmuelRonen
Copy link

While execute got this error:

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

Here is the full list:

C:\vlad\automatic\extensions\SadTalker\checkpoints\auido2pose_00140-model.pth
C:\vlad\automatic\extensions\SadTalker\checkpoints\shape_predictor_68_face_landmarks.dat
C:\vlad\automatic\extensions\SadTalker\checkpoints\facevid2vid_00189-model.pth.tar
C:\Users\Public\Documents\Wondershare\CreatorTemp\gradio\e648b24cb5df7103ff5a4a7287b7affd98f1e794\tmpeck_h143.png
landmark Det:: 0%| | 0/1 [00:01<?, ?it/s]
Traceback (most recent call last):
File "C:\vlad\automatic\venv\lib\site-packages\gradio\routes.py", line 414, in run_predict
output = await app.get_blocks().process_api(
File "C:\vlad\automatic\venv\lib\site-packages\gradio\blocks.py", line 1323, in process_api
result = await self.call_function(
File "C:\vlad\automatic\venv\lib\site-packages\gradio\blocks.py", line 1051, in call_function
prediction = await anyio.to_thread.run_sync(
File "C:\vlad\automatic\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "C:\vlad\automatic\venv\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "C:\vlad\automatic\venv\lib\site-packages\anyio_backends_asyncio.py", line 867, in run
result = context.run(func, *args)
File "C:\vlad\automatic\modules\call_queue.py", line 15, in f
res = func(*args, **kwargs)
File "C:\vlad\automatic/extensions/SadTalker\src\gradio_demo.py", line 111, in test
first_coeff_path, crop_pic_path, crop_info = self.preprocess_model.generate(pic_path, first_frame_dir, preprocess)
File "C:\vlad\automatic/extensions/SadTalker\src\utils\preprocess.py", line 122, in generate
lm = self.kp_extractor.extract_keypoint(frames_pil, landmarks_path)
File "C:\vlad\automatic/extensions/SadTalker\src\face3d\extract_kp_videos_safe.py", line 39, in extract_keypoint
current_kp = self.extract_keypoint(image)
File "C:\vlad\automatic/extensions/SadTalker\src\face3d\extract_kp_videos_safe.py", line 65, in extract_keypoint
keypoints = landmark_98_to_68(self.detector.get_landmarks(img)) # [0]
File "C:\vlad\automatic\venv\lib\site-packages\facexlib\alignment\awing_arch.py", line 373, in get_landmarks
pred = calculate_points(heatmaps).reshape(-1, 2)
File "C:\vlad\automatic\venv\lib\site-packages\facexlib\alignment\awing_arch.py", line 18, in calculate_points
preds = preds.astype(np.float, copy=False)
File "C:\vlad\automatic\venv\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

@vinthony
Copy link
Collaborator

vinthony commented May 19, 2023

@vinthony
Copy link
Collaborator

I will check this problem caused by the 3rd lib

@ShmuelRonen
Copy link
Author

I will check this problem caused by the 3rd lib

This will require you to make some changes to the code, but I think it's the right thing to do. That way many users will be able to continue using SadTalker!

@ShmuelRonen
Copy link
Author

Are you work on updated version?

@vinthony
Copy link
Collaborator

I think it has been fixed in the newer version?

@TimPietrusky
Copy link

TimPietrusky commented Jun 28, 2023

@vinthony This is not fixed, as the problem is in the underlying facexlib package. There is already a PR xinntao/facexlib#38 that will fix that problem, but it's not merged yet.

I stumbled upon this, because I had to use a newer version of pytorch (because of problems running SadTalker on a H100 GPU) and this updated numpy to a new version. And that new version has no support anymore for float.

@ShmuelRonen What I did was to install a supported version and I could run SadTalker without a problem then:

pip install numpy==1.23.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants