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

TypeError: RetinaFace.detect() got an unexpected keyword argument 'threshold' #407

Open
phpdesigner opened this issue May 11, 2023 · 3 comments

Comments

@phpdesigner
Copy link

i just use:
python test_video_swapsingle.py --crop_size 224 --use_mask --name people --Arc_path arcface_model/arcface_checkpoint.tar --pic_a_path ./demo_file/Iron_man.jpg --video_path ./demo_file/multi_people_1080p.mp4 --output_path ./output/multi_test_swapsingle.mp4 --temp_path ./temp_results

it's not work. err:

Applied providers: ['CUDAExecutionProvider', 'CPUExecutionProvider'], with options: {'CUDAExecutionProvider': {'do_copy_in_default_stream': '1', 'cudnn_conv_algo_search': 'EXHAUSTIVE', 'device_id': '0', 'gpu_external_alloc': '0', 'enable_cuda_graph': '0', 'gpu_mem_limit': '18446744073709551615', 'gpu_external_free': '0', 'gpu_external_empty_cache': '0', 'arena_extend_strategy': 'kNextPowerOfTwo', 'cudnn_conv_use_max_workspace': '1', 'cudnn_conv1d_pad_to_nc1d': '0', 'tunable_op_enabled': '0'}, 'CPUExecutionProvider': {}}
find model: ./insightface_func/models\antelope\glintr100.onnx recognition
Applied providers: ['CUDAExecutionProvider', 'CPUExecutionProvider'], with options: {'CUDAExecutionProvider': {'do_copy_in_default_stream': '1', 'cudnn_conv_algo_search': 'EXHAUSTIVE', 'device_id': '0', 'gpu_external_alloc': '0', 'enable_cuda_graph': '0', 'gpu_mem_limit': '18446744073709551615', 'gpu_external_free': '0', 'gpu_external_empty_cache': '0', 'arena_extend_strategy': 'kNextPowerOfTwo', 'cudnn_conv_use_max_workspace': '1', 'cudnn_conv1d_pad_to_nc1d': '0', 'tunable_op_enabled': '0'}, 'CPUExecutionProvider': {}}
find model: ./insightface_func/models\antelope\scrfd_10g_bnkps.onnx detection
set det-size: (640, 640)
Traceback (most recent call last):
File "E:\openai\faceswap\SimSwap\test_video_swapsingle.py", line 64, in
img_a_align_crop, _ = app.get(img_a_whole,crop_size)
File "E:\openai\faceswap\SimSwap\insightface_func\face_detect_crop_single.py", line 64, in get
bboxes, kpss = self.det_model.detect(img,
TypeError: RetinaFace.detect() got an unexpected keyword argument 'threshold'

@phpdesigner
Copy link
Author

torch 2.0.1+cu118
torchaudio 2.0.2+cu118
torchvision 0.15.2+cu118
onnx 1.14.0
onnxruntime-gpu 1.14.1
opencv-python 4.7.0.72
opencv-python-headless 4.7.0.72
moviepy 1.0.3
imageio 2.28.1
insightface 0.7.3

@weTerence
Copy link

@phpdesigner The problem was caused by the wrong version of torch. I tried torch==1.12 and then the bug was gone

@woctezuma
Copy link

Related:

I can fix this with:

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