|
步骤11:开始训练
python main.py data/liushiqi --workspace model/trial_liushiqi -O --iters 60000 --asr_model ave
[INFO] Trainer: ngp | 2024-11-23_10-27-07 | cuda | fp16 | model/trial_liushiqi
[INFO] #parameters: 768165
[INFO] Loading latest checkpoint ...
[WARN] No checkpoint found, model randomly initialized.
[INFO] load 100 val frames.
[INFO] load aud_features: torch.Size([5565, 1, 512])
Loading val data: 100%|████████████████████████████████████████████████████████████| 100/100 [00:00<00:00, 1334.10it/s]
[INFO] eye_area: 0.0023155224043875933 - 0.7356387972831726
[INFO] max_epoch = 12
==> Start Training Epoch 1, lr=0.001000 ...
loss=0.0091 (0.0134), lr=0.000943: : 100% 5057/5057 [07:34<00:00, 11.13it/s]
loss=0.0134
==> Finished Epoch 1.
++> Evaluate at epoch 1 ...
0% 0/100 [00:00<?, ?it/s]G:\BaiduNetdiskDownload\SyncTalk-Windows\face-SyncTalk\venv\lib\site-packages\torch\nn\modules\module.py:1501: UserWarning: FALLBACK path has been taken inside: torch::jit::fuser::cuda::runCudaFusionGroup. This is an indication that codegen Failed for some reason.
To debug try disable codegen fallback path via setting the env variable `export PYTORCH_NVFUSER_DISABLE=fallback`
(Triggered internally at C:\cb\pytorch_1000000000000\work\third_party\nvfuser\csrc\manager.cpp:340.)
return forward_call(*args, **kwargs)
loss=0.0121 (0.0108): : 97% 97/100 [00:43<00:00, 3.90it/s]G:\BaiduNetdiskDownload\SyncTalk-Windows\face-SyncTalk\venv\lib\site-packages\face_alignment\api.py:147: UserWarning: No faces were detected.
warnings.warn("No faces were detected.")
Traceback (most recent call last):
File "G:\BaiduNetdiskDownload\SyncTalk-Windows\face-SyncTalk\SyncTalk\main.py", line 249, in <module>
trainer.train(train_loader, valid_loader, max_epochs)
File "G:\BaiduNetdiskDownload\SyncTalk-Windows\face-SyncTalk\SyncTalk\nerf_triplane\utils.py", line 1031, in train
self.evaluate_one_epoch(valid_loader)
File "G:\BaiduNetdiskDownload\SyncTalk-Windows\face-SyncTalk\SyncTalk\nerf_triplane\utils.py", line 1403, in evaluate_one_epoch
metric.update(preds, truths)
File "G:\BaiduNetdiskDownload\SyncTalk-Windows\face-SyncTalk\SyncTalk\nerf_triplane\utils.py", line 589, in update
lms_pred = self.get_landmarks(preds)
File "G:\BaiduNetdiskDownload\SyncTalk-Windows\face-SyncTalk\SyncTalk\nerf_triplane\utils.py", line 560, in get_landmarks
lms = self.predictor.get_landmarks(img)[-1]
TypeError: 'NoneType' object is not subscriptable
loss=0.0121 (0.0108): : 97% 97/100 [00:44<00:01, 2.18it/s]
No faces were detected.
lms = self.predictor.get_landmarks(img)[-1]
#img: 输入图像(假设是RGB格式),用于关键点检测。lms: 面部的 68个关键点坐标,返回为一个 (68, 2) 的 numpy 数组,数据类型为 float32
def get_landmarks(self, img):
if self.backend == 'dlib': #如果是 dlib 后端,使用 Dlib 的面部检测器和关键点预测器
dets = self.detector(img, 1)
for det in dets:
shape = self.predictor(img, det)
# ref: https://github.com/PyImageSearch ... ce_utils/helpers.py
lms = np.zeros((68, 2), dtype=np.int32)
for i in range(0, 68):
lms[i, 0] = shape.part(i).x
lms[i, 1] = shape.part(i).y
break
else:
lms = self.predictor.get_landmarks(img)[-1]
# self.vis_landmarks(img, lms)
lms = lms.astype(np.float32)
return lms
用于从给定图像中提取面部的 68个关键点(landmarks)。它支持两种不同的关键点检测后端:dlib 和其他自定义的检测器。
返回了 None,而代码试图对 None 进行索引操作 [-1],因此触发了 TypeError: 'NoneType' object is not subscriptable。
问题原因:代码版本混乱所致
解决办法:去官网下载文件覆盖本地对应文件
======================================================================
CUDA NVRTC compile error: nvrtc: error: failed to open nvrtc-builtins64_117.dll.
Make sure that nvrtc-builtins64_117.dll is installed correctly.
解决办法:
下载缺失文件nvrtc-builtins64_117.dll
拷贝到指定目录C:\ Windows\ System32
点击运行即可
|
|