Closed qinghew closed 1 month ago
i change
aligned_x1, orig_pred_ldmks1, aligned_ldmks1, score1, thetas1, normalized_bbox1 = aligner(input1)
aligned_x2, orig_pred_ldmks2, aligned_ldmks2, score2, thetas2, normalized_bbox2 = aligner(input2)
feat1 = fr_model(aligned_x1)
feat2 = fr_model(aligned_x2)
to:
aligned_x1, orig_pred_ldmks1, aligned_ldmks1, score1, thetas1, normalized_bbox1 = aligner(input1)
aligned_x2, orig_pred_ldmks2, aligned_ldmks2, score2, thetas2, normalized_bbox2 = aligner(input2)
feat1 = fr_model(aligned_x1, aligned_ldmks1)
feat2 = fr_model(aligned_x2, aligned_ldmks2)
it will work!
Thanks for pointing out! The code has been updated.
the default value of keypoints is None, but make_kprpe_input will use the keypoints extra_ctx = make_kprpe_input(keypoints, x, self.keypoint_linear, self.rpe_config, self.mask_ratio, self.depth, self.num_heads, self.num_buckets)
Traceback (most recent call last): File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/root/.local/share/code-server/extensions/ms-python.debugpy-2024.6.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/main.py", line 39, in
cli.main()
File "/root/.local/share/code-server/extensions/ms-python.debugpy-2024.6.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 430, in main
run()
File "/root/.local/share/code-server/extensions/ms-python.debugpy-2024.6.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 284, in run_file
runpy.run_path(target, run_name="main")
File "/root/.local/share/code-server/extensions/ms-python.debugpy-2024.6.0-linux-x64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 321, in run_path
return _run_module_code(code, init_globals, run_name,
File "/root/.local/share/code-server/extensions/ms-python.debugpy-2024.6.0-linux-x64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 135, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/root/.local/share/code-server/extensions/ms-python.debugpy-2024.6.0-linux-x64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 124, in _run_code
exec(code, run_globals)
File "/m2v_intern/wangqinghe/codes/baselines/wqh-face2text-diffusers-basic/AdaFace_vit/verify.py", line 75, in
feat1 = fr_model(aligned_x1)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, kwargs)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, *kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/cvlface_adaface_vit_base_kprpe_webface4m/wrapper.py", line 27, in forward
return self.model(args, kwargs)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, kwargs)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, *kwargs)
File "/m2v_intern/wangqinghe/codes/baselines/wqh-face2text-diffusers-basic/AdaFace_vit/cvlface_adaface_vit_base_kprpe_webface4m/models/vit_kprpe/init.py", line 47, in forward
return self.net(x, args, kwargs)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, *kwargs)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(args, kwargs)
File "/m2v_intern/wangqinghe/codes/baselines/wqh-face2text-diffusers-basic/AdaFace_vit/cvlface_adaface_vit_base_kprpe_webface4m/models/vit_kprpe/vit.py", line 310, in forward
x = self.forward_features(x, keypoints=keypoints)
File "/m2v_intern/wangqinghe/codes/baselines/wqh-face2text-diffusers-basic/AdaFace_vit/cvlface_adaface_vit_base_kprpe_webface4m/models/vit_kprpe/vit.py", line 288, in forward_features
extra_ctx = make_kprpe_input(keypoints, x, self.keypoint_linear, self.rpe_config, self.mask_ratio,
File "/m2v_intern/wangqinghe/codes/baselines/wqh-face2text-diffusers-basic/AdaFace_vit/cvlface_adaface_vit_base_kprpe_webface4m/models/vit_kprpe/rpe_options.py", line 109, in make_kprpe_input
rel_keypoints = relative_keypoints.make_rel_keypoints(keypoints, x)[:, :, :2 num_kp]
File "/usr/local/lib/python3.8/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(args, kwargs)
File "/m2v_intern/wangqinghe/codes/baselines/wqh-face2text-diffusers-basic/AdaFace_vit/cvlface_adaface_vit_base_kprpe_webface4m/models/vit_kprpe/RPE/KPRPE/relative_keypoints.py", line 16, in make_rel_keypoints
_keyponints = keyponints.unsqueeze(-3) # Bx1x5x2
AttributeError: 'NoneType' object has no attribute 'unsqueeze'