Open ShmuelRonen opened 1 year ago
it seem the numpy are in a higher version: https://stackoverflow.com/questions/74844262/how-can-i-solve-error-module-numpy-has-no-attribute-float-in-python
I will check this problem caused by the 3rd lib
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!
Are you work on updated version?
I think it has been fixed in the newer version?
@vinthony This is not fixed, as the problem is in the underlying facexlib
package. There is already a PR https://github.com/xinntao/facexlib/pull/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
While execute got this error:
AttributeError: module 'numpy' has no attribute 'float'.
np.float
was a deprecated alias for the builtinfloat
. To avoid this error in existing code, usefloat
by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, usenp.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#deprecationsHere 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 builtinfloat
. To avoid this error in existing code, usefloat
by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, usenp.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