neuralchen / SimSwap

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

onnxruntime_providers_tensorrt.dll Failed - geforce rtx 3080 CUDA sm86 architecture #335

Open r3dzone81 opened 2 years ago

r3dzone81 commented 2 years ago

When I put this standard instruction for a simple test I have this error:

(simswap) PS C:\simswap> 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 ------------ Options ------------- Arc_path: arcface_model/arcface_checkpoint.tar aspect_ratio: 1.0 batchSize: 8 checkpoints_dir: ./checkpoints cluster_path: features_clustered_010.npy crop_size: 224 data_type: 32 dataroot: ./datasets/cityscapes/ display_winsize: 512 engine: None export_onnx: None feat_num: 3 fineSize: 512 fp16: False gpu_ids: [0] how_many: 50 id_thres: 0.03 image_size: 224 input_nc: 3 instance_feat: False isTrain: False label_feat: False label_nc: 0 latent_size: 512 loadSize: 1024 load_features: False local_rank: 0 max_dataset_size: inf model: pix2pixHD multisepcific_dir: ./demo_file/multispecific nThreads: 2 n_blocks_global: 6 n_blocks_local: 3 n_clusters: 10 n_downsample_E: 4 n_downsample_global: 3 n_local_enhancers: 1 name: people nef: 16 netG: global ngf: 64 niter_fix_global: 0 no_flip: False no_instance: False no_simswaplogo: False norm: batch norm_G: spectralspadesyncbatch3x3 ntest: inf onnx: None output_nc: 3 output_path: ./output/multi_test_swapsingle.mp4 phase: test pic_a_path: ./demo_file/Iron_man.jpg pic_b_path: ./crop_224/zrf.jpg pic_specific_path: ./crop_224/zrf.jpg resize_or_crop: scale_width results_dir: ./results/ semantic_nc: 3 serial_batches: False temp_path: ./temp_results tf_log: False use_dropout: False use_encoded_image: False use_mask: True verbose: False video_path: ./demo_file/multi_people_1080p.mp4 which_epoch: latest -------------- End ---------------- Traceback (most recent call last): File "test_video_swapsingle.py", line 58, in app = Face_detect_crop(name='antelope', root='./insightface_func/models') File "C:\simswap\insightface_func\face_detect_crop_single.py", line 40, in init model = model_zoo.get_model(onnx_file) File "C:\Users\FRhymes\miniconda3\envs\simswap\lib\site-packages\insightface\model_zoo\model_zoo.py", line 56, in get_model model = router.get_model() File "C:\Users\FRhymes\miniconda3\envs\simswap\lib\site-packages\insightface\model_zoo\model_zoo.py", line 23, in get_model session = onnxruntime.InferenceSession(self.onnx_file, providers=['TensorrtExecutionProvider', 'CUDAExecutionProvider']) File "C:\Users\FRhymes\miniconda3\envs\simswap\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 347, in init self._create_inference_session(providers, provider_options, disabled_optimizers) File "C:\Users\FRhymes\miniconda3\envs\simswap\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 395, in _create_inference_session sess.initialize_session(providers, provider_options, disabled_optimizers) RuntimeError: D:\a_work\1\s\onnxruntime\core\session\provider_bridge_ort.cc:1069 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError] : 1 : FAIL : LoadLibrary failed with error 126 "" when trying to load "C:\Users\FRhymes\miniconda3\envs\simswap\lib\site-packages\onnxruntime\capi\onnxruntime_providers_tensorrt.dll"

I have installed all Tensorrt and cuDNN release configured all ambient environment (variable) I have rtx 3080 windows 10. My pip list is (simswap) PS C:\simswap> pip list Package Version


absl-py 1.3.0 altgraph 0.17.3 astunparse 1.6.3 brotlipy 0.7.0 cachetools 5.2.0 certifi 2022.9.24 cffi 1.15.1 charset-normalizer 2.1.1 colorama 0.4.6 coloredlogs 15.0.1 cryptography 37.0.4 cycler 0.11.0 decorator 4.4.2 easydict 1.10 flatbuffers 22.9.24 fonttools 4.38.0 future 0.18.2 gast 0.4.0 google-auth 2.13.0 google-auth-oauthlib 0.4.6 google-pasta 0.2.0 grpcio 1.50.0 h5py 3.7.0 humanfriendly 10.0 idna 3.4 imageio 2.22.2 imageio-ffmpeg 0.4.7 importlib-metadata 5.0.0 insightface 0.2.1 joblib 1.2.0 keras 2.10.0 Keras-Preprocessing 1.1.2 kiwisolver 1.4.4 libclang 14.0.6 Markdown 3.4.1 MarkupSafe 2.1.1 matplotlib 3.5.3 moviepy 1.0.3 mpmath 1.2.1 networkx 2.6.3 numpy 1.21.6 nvidia-pyindex 1.0.9 oauthlib 3.2.2 onnx 1.12.0 onnx-graphsurgeon 0.3.12 onnxruntime-gpu 1.13.1 opencv-python 4.6.0.66 opt-einsum 3.3.0 packaging 21.3 pefile 2022.5.30 Pillow 9.2.0 pip 22.2.2 proglog 0.1.10 protobuf 3.19.6 pyasn1 0.4.8 pyasn1-modules 0.2.8 pycparser 2.21 pyinstaller 5.6.1 pyinstaller-hooks-contrib 2022.10 pyOpenSSL 22.0.0 pyparsing 3.0.9 pyreadline 2.1 PySocks 1.7.1 python-dateutil 2.8.2 PyWavelets 1.3.0 pywin32-ctypes 0.2.0 requests 2.28.1 requests-oauthlib 1.3.1 rsa 4.9 scikit-image 0.19.3 scikit-learn 1.0.2 scipy 1.7.3 setuptools 63.4.1 six 1.16.0 sympy 1.10.1 tensorboard 2.10.1 tensorboard-data-server 0.6.1 tensorboard-plugin-wit 1.8.1 tensorflow 2.10.0 tensorflow-estimator 2.10.0 tensorflow-io-gcs-filesystem 0.27.0 termcolor 2.0.1 threadpoolctl 3.1.0 tifffile 2021.11.2 torch 1.12.1 torchaudio 0.12.1 torchvision 0.13.1 tqdm 4.64.1 typing_extensions 4.4.0 urllib3 1.26.11 Werkzeug 2.2.2 wheel 0.37.1 win-inet-pton 1.1.0 wincertstore 0.2 wrapt 1.14.1 zipp 3.10.0

this is my sequence of commands in env simswap: conda create -n simswap python=3.7 conda activate simswap conda install pytorch torchvision torchaudio cudatoolkit=11.6 -c pytorch -c conda-forge pip install --ignore-installed imageio pip install onnxruntime-gpu pip install moviepy pip install insightface==0.2.1 pip install nvidia-pyindex pip install tensorflow

but I don't know how resolve this problem: -------------- End ---------------- Traceback (most recent call last): File "test_video_swapsingle.py", line 58, in app = Face_detect_crop(name='antelope', root='./insightface_func/models') File "C:\simswap\insightface_func\face_detect_crop_single.py", line 40, in init model = model_zoo.get_model(onnx_file) File "C:\Users\FRhymes\miniconda3\envs\simswap\lib\site-packages\insightface\model_zoo\model_zoo.py", line 56, in get_model model = router.get_model() File "C:\Users\FRhymes\miniconda3\envs\simswap\lib\site-packages\insightface\model_zoo\model_zoo.py", line 23, in get_model session = onnxruntime.InferenceSession(self.onnx_file, providers=['TensorrtExecutionProvider', 'CUDAExecutionProvider']) File "C:\Users\FRhymes\miniconda3\envs\simswap\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 347, in init self._create_inference_session(providers, provider_options, disabled_optimizers) File "C:\Users\FRhymes\miniconda3\envs\simswap\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 395, in _create_inference_session sess.initialize_session(providers, provider_options, disabled_optimizers) RuntimeError: D:\a_work\1\s\onnxruntime\core\session\provider_bridge_ort.cc:1069 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError] : 1 : FAIL : LoadLibrary failed with error 126 "" when trying to load "C:\Users\FRhymes\miniconda3\envs\simswap\lib\site-packages\onnxruntime\capi\onnxruntime_providers_tensorrt.dll"

I have python version 3.7 env simswap

r3dzone81 commented 2 years ago

solved. I don't have installed pip install onnxruntime (simple installation skipped)