neuralchen / SimSwap

An arbitrary face-swapping framework on images and videos with one single trained model!
Other
4.55k stars 895 forks source link

Total new to all this please help #293

Open LongjonSlim opened 2 years ago

LongjonSlim commented 2 years ago

I followed the tutorial exactly however when i try to run it i get this

Traceback (most recent call last): File "test_video_swapsingle.py", line 58, in app = Face_detect_crop(name='antelope', root='./insightface_func/models') File "E:\Anaconda\envs\simswap\SimSwap-main\insightface_func\face_detect_crop_single.py", line 40, in init model = model_zoo.get_model(onnx_file) File "E:\Anaconda\envs\simswap\lib\site-packages\insightface\model_zoo\model_zoo.py", line 56, in get_model model = router.get_model() File "E:\Anaconda\envs\simswap\lib\site-packages\insightface\model_zoo\model_zoo.py", line 23, in get_model session = onnxruntime.InferenceSession(self.onnx_file, None) File "E:\Anaconda\envs\simswap\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 335, in init self._create_inference_session(providers, provider_options, disabled_optimizers) File "E:\Anaconda\envs\simswap\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 364, in _create_inference_session "onnxruntime.InferenceSession(..., providers={}, ...)".format(available_providers)) ValueError: This ORT build has ['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'] enabled. Since ORT 1.9, you are required to explicitly set the providers parameter when instantiating InferenceSession. For example, onnxruntime.InferenceSession(..., providers=['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'], ...)

Any help would be great thank you.

Christosioan commented 2 years ago

I've had the same problem and I tried adding the providers. However, now I am getting this:

app = Face_detect_crop(name='antelope', root='./insightface_func/models', providers=['CUDAExecutionProvider', 'CPUExecutionProvider']) TypeError: init() got an unexpected keyword argument 'providers'

sshivs commented 2 years ago

Not the OP, but there are some more changes needed to pass it further upto the onnx inference object.

Mayorc1978 commented 1 year ago

I've the same problem and I didn't solve the issue can you specify the other needed changes to make it work. Cause even with ExponentialML corrections I still get the same error.