SadTalker icon indicating copy to clipboard operation
SadTalker copied to clipboard

[Issue] ValueError: setting an array element with a sequence.

Open siddharthahiremath opened this issue 2 years ago • 3 comments

Mac M1using safetensor as default {'checkpoint': 'checkpoints/SadTalker_V0.0.2_256.safetensors', 'dir_of_BFM_fitting': 'src/config', 'audio2pose_yaml_path': 'src/config/auido2pose.yaml', 'audio2exp_yaml_path': 'src/config/auido2exp.yaml', 'use_safetensor': True, 'mappingnet_checkpoint': 'checkpoints/mapping_00229-model.pth.tar', 'facerender_yaml': 'src/config/facerender.yaml'} /private/var/folders/dq/qn9smpk56lz_v4cjyx42gcfw0000gn/T/gradio/f025e7772587be8e91b9b4cb1b5c0041f5ca7da5/full_body_1.png landmark Det:: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 3.23it/s] 3DMM Extraction In Video:: 0%| | 0/1 [00:00<?, ?it/s] Traceback (most recent call last): File "/opt/homebrew/lib/python3.11/site-packages/gradio/queueing.py", line 489, in call_prediction output = await route_utils.call_process_api( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/gradio/route_utils.py", line 232, in call_process_api output = await app.get_blocks().process_api( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/gradio/blocks.py", line 1561, in process_api result = await self.call_function( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/gradio/blocks.py", line 1179, in call_function prediction = await anyio.to_thread.run_sync( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/anyio/to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread return await future ^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 807, in run result = context.run(func, *args) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/gradio/utils.py", line 678, in wrapper response = f(*args, **kwargs) ^^^^^^^^^^^^^^^^^^ File "/Users/siddharthahiremath/SadTalker/src/gradio_demo.py", line 96, in test first_coeff_path, crop_pic_path, crop_info = self.preprocess_model.generate(pic_path, first_frame_dir, preprocess, True, size) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/siddharthahiremath/SadTalker/src/utils/preprocess.py", line 146, in generate trans_params, im1, lm1, _ = align_img(frame, lm1, self.lm3d_std) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/siddharthahiremath/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.

siddharthahiremath avatar Dec 31 '23 23:12 siddharthahiremath

Mac M1 使用 safetensor 默认 {'checkpoint': 'checkpoints/SadTalker_V0.0.2_256.safetensors', 'dir_of_BFM_fitting': 'src/config', 'audio2pose_yaml_path': 'src/config/auido2pose.yaml', 'audio2exp_yaml_path': ' src/config/auido2exp.yaml', 'use_safetensor': True, 'mappingnet_checkpoint': 'checkpoints/mapping_00229-model.pth.tar', 'facerender_yaml': 'src/config/facerender.yaml'} /private/var /文件夹/DQ/QN9SMPK56LZ_V4CJYX42GCFW0000GN/T/gradio/F025E77772587BE8E91B9B9B9B4CB1B1B1B5C0041F5CA7DCA7DA5A5/full_body_1.png Landmark Det :: 100%| ███████████████████████████████████████████████████ █ █████████████████████████████████████████| 1/1 [00:00<00:00, 3.23it/s] 视频中的 3DMM 提取:: 0%| | 0/1 [00:00<?, ?it/s] 回溯(最近一次调用): 文件“/opt/homebrew/lib/python3.11/site-packages/gradio/queueing.py”,第489行,在call_prediction 输出=等待route_utils.call_process_api( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 文件“/opt/ homebrew /lib/python3.11/site-packages/gradio/route_utils.py”,第 232 行,在 call_process_api 输出 = 等待 app.get_blocks().process_api( ^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^ 文件“/opt/homebrew/lib/python3.11/site-packages/gradio/blocks.py”,第1561行,process_api 结果 = 等待 self.call_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 文件 "/opt/homebrew/lib/python3.11/site -packages/gradio/blocks .py”,第1179行,在call_function Prediction = wait anyio.to_thread.run_sync( ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ 文件中“/opt/homebrew/lib/python3.11/site-packages/anyio/to_thread.py”,第33行,在run_sync 返回中等待 get_asynclib().run_sync_in_worker_thread( ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 文件“ /opt/homebrew/lib/python3.11/site-packages/anyio/_backends/_asyncio.py”,第877行,在run_sync_in_worker_thread 返回等待未来 ^^^^^^^^^^^^^ 文件“/opt/ homebrew/lib/python3.11/site-packages/anyio/_backends/ _asyncio.py”,第807行,运行 结果 = context.run(func, *args) ^^^^^^^^^^^^^^ ^^^^^^^^^^^ 文件“/opt/homebrew/lib/python3.11/site-packages/gradio/utils.py”,第678行,包装器 响应 = f(*args, ** kwargs) ^^^^^^^^^^^^^^^ ^^^ 文件“/Users/siddharthahiremath/SadTalker/src/gradio_demo.py”,第96行,测试中 first_coeff_path,crop_pic_path,crop_info = self. preprocess_model.generate(pic_path,first_frame_dir,预处理,True, 文件“/Users/siddharthahiremath/SadTalker/src/utils/preprocess.py”,第146行,生成 trans_params, im1, lm1, _ =align_img(frame, lm1, self.lm3d_std) ^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 文件“/Users/siddharthahiremath/SadTalker/src/face3d/util/preprocess.py”,第101行,在align_img trans_params = np.array([w0, h0, s, t[0], t[1]]) ^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^ ValueError:用序列设置阵列元素。请求的阵列在1维之后具有不均匀的形状。检测到的形状为(5,)+不均匀部分。

trans_params = np.array([w0, h0, s, t[0], t[1]]) 修改为trans_params = np.array([w0, h0, s, t[0], t[1]], dtype=object)

xuxuxbaobao2 avatar Jan 23 '24 09:01 xuxuxbaobao2

using safetensor as default 3DMM Extraction for source image landmark Det:: 100%|████████████████████████████| 1/1 [00:00<00:00, 1.18it/s] 3DMM Extraction In Video:: 0%| | 0/1 [00:00<?, ?it/s] Traceback (most recent call last): File "/Users/user/SadTalker/inference.py", line 144, in main(args) File "/Users/user/SadTalker/inference.py", line 46, in main first_coeff_path, crop_pic_path, crop_info = preprocess_model.generate(pic_path, first_frame_dir, args.preprocess,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/user/SadTalker/src/utils/preprocess.py", line 146, in generate trans_params, im1, lm1, _ = align_img(frame, lm1, self.lm3d_std) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/user/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.

arturhak24 avatar Mar 05 '24 11:03 arturhak24