New User- Getting this error(?) while trying to run. Any help is greatly appreciated #272

Open
opened 2022-05-28 11:12:00 +02:00 by acetony01 · 3 comments
acetony01 commented 2022-05-28 11:12:00 +02:00 (Migrated from github.com)

G:\DFL\Anaconda\envs\simswap\lib\site-packages\torch\serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.parallel.data_parallel.DataParallel' has changed. Tried to save a patch, but couldn't create a writable file DataParallel.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
G:\DFL\Anaconda\envs\simswap\lib\site-packages\torch\serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.conv.Conv2d' has changed. Tried to save a patch, but couldn't create a writable file Conv2d.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
G:\DFL\Anaconda\envs\simswap\lib\site-packages\torch\serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.batchnorm.BatchNorm2d' has changed. Tried to save a patch, but couldn't create a writable file BatchNorm2d.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
G:\DFL\Anaconda\envs\simswap\lib\site-packages\torch\serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.activation.PReLU' has changed. Tried to save a patch, but couldn't create a writable file PReLU.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
G:\DFL\Anaconda\envs\simswap\lib\site-packages\torch\serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.pooling.MaxPool2d' has changed. Tried to save a patch, but couldn't create a writable file MaxPool2d.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
G:\DFL\Anaconda\envs\simswap\lib\site-packages\torch\serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.container.Sequential' has changed. Tried to save a patch, but couldn't create a writable file Sequential.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
G:\DFL\Anaconda\envs\simswap\lib\site-packages\torch\serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.pooling.AdaptiveAvgPool2d' has changed. Tried to save a patch, but couldn't create a writable file AdaptiveAvgPool2d.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
G:\DFL\Anaconda\envs\simswap\lib\site-packages\torch\serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.linear.Linear' has changed. Tried to save a patch, but couldn't create a writable file Linear.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
G:\DFL\Anaconda\envs\simswap\lib\site-packages\torch\serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.activation.Sigmoid' has changed. Tried to save a patch, but couldn't create a writable file Sigmoid.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
G:\DFL\Anaconda\envs\simswap\lib\site-packages\torch\serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.dropout.Dropout' has changed. Tried to save a patch, but couldn't create a writable file Dropout.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
G:\DFL\Anaconda\envs\simswap\lib\site-packages\torch\serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.batchnorm.BatchNorm1d' has changed. Tried to save a patch, but couldn't create a writable file BatchNorm1d.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
Traceback (most recent call last):
File "test_wholeimage_swapsingle.py", line 55, in
app = Face_detect_crop(name='antelope', root='./insightface_func/models')
File "G:\DFL\Simswap\insightface_func\face_detect_crop_single.py", line 40, in init
model = model_zoo.get_model(onnx_file)
File "G:\DFL\Anaconda\envs\simswap\lib\site-packages\insightface\model_zoo\model_zoo.py", line 56, in get_model
model = router.get_model()
File "G:\DFL\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 "G:\DFL\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 "G:\DFL\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'], ...)

G:\DFL\Anaconda\envs\simswap\lib\site-packages\torch\serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.parallel.data_parallel.DataParallel' has changed. Tried to save a patch, but couldn't create a writable file DataParallel.patch. Make sure it doesn't exist and your working directory is writable. warnings.warn(msg, SourceChangeWarning) G:\DFL\Anaconda\envs\simswap\lib\site-packages\torch\serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.conv.Conv2d' has changed. Tried to save a patch, but couldn't create a writable file Conv2d.patch. Make sure it doesn't exist and your working directory is writable. warnings.warn(msg, SourceChangeWarning) G:\DFL\Anaconda\envs\simswap\lib\site-packages\torch\serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.batchnorm.BatchNorm2d' has changed. Tried to save a patch, but couldn't create a writable file BatchNorm2d.patch. Make sure it doesn't exist and your working directory is writable. warnings.warn(msg, SourceChangeWarning) G:\DFL\Anaconda\envs\simswap\lib\site-packages\torch\serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.activation.PReLU' has changed. Tried to save a patch, but couldn't create a writable file PReLU.patch. Make sure it doesn't exist and your working directory is writable. warnings.warn(msg, SourceChangeWarning) G:\DFL\Anaconda\envs\simswap\lib\site-packages\torch\serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.pooling.MaxPool2d' has changed. Tried to save a patch, but couldn't create a writable file MaxPool2d.patch. Make sure it doesn't exist and your working directory is writable. warnings.warn(msg, SourceChangeWarning) G:\DFL\Anaconda\envs\simswap\lib\site-packages\torch\serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.container.Sequential' has changed. Tried to save a patch, but couldn't create a writable file Sequential.patch. Make sure it doesn't exist and your working directory is writable. warnings.warn(msg, SourceChangeWarning) G:\DFL\Anaconda\envs\simswap\lib\site-packages\torch\serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.pooling.AdaptiveAvgPool2d' has changed. Tried to save a patch, but couldn't create a writable file AdaptiveAvgPool2d.patch. Make sure it doesn't exist and your working directory is writable. warnings.warn(msg, SourceChangeWarning) G:\DFL\Anaconda\envs\simswap\lib\site-packages\torch\serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.linear.Linear' has changed. Tried to save a patch, but couldn't create a writable file Linear.patch. Make sure it doesn't exist and your working directory is writable. warnings.warn(msg, SourceChangeWarning) G:\DFL\Anaconda\envs\simswap\lib\site-packages\torch\serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.activation.Sigmoid' has changed. Tried to save a patch, but couldn't create a writable file Sigmoid.patch. Make sure it doesn't exist and your working directory is writable. warnings.warn(msg, SourceChangeWarning) G:\DFL\Anaconda\envs\simswap\lib\site-packages\torch\serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.dropout.Dropout' has changed. Tried to save a patch, but couldn't create a writable file Dropout.patch. Make sure it doesn't exist and your working directory is writable. warnings.warn(msg, SourceChangeWarning) G:\DFL\Anaconda\envs\simswap\lib\site-packages\torch\serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.batchnorm.BatchNorm1d' has changed. Tried to save a patch, but couldn't create a writable file BatchNorm1d.patch. Make sure it doesn't exist and your working directory is writable. warnings.warn(msg, SourceChangeWarning) Traceback (most recent call last): File "test_wholeimage_swapsingle.py", line 55, in <module> app = Face_detect_crop(name='antelope', root='./insightface_func/models') File "G:\DFL\Simswap\insightface_func\face_detect_crop_single.py", line 40, in __init__ model = model_zoo.get_model(onnx_file) File "G:\DFL\Anaconda\envs\simswap\lib\site-packages\insightface\model_zoo\model_zoo.py", line 56, in get_model model = router.get_model() File "G:\DFL\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 "G:\DFL\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 "G:\DFL\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'], ...)
netrunner-exe commented 2022-05-28 12:26:15 +02:00 (Migrated from github.com)

Try pip uninstall -y onnxruntime-gpu and pip install onnxruntime-gpu==1.9.0

Try `pip uninstall -y onnxruntime-gpu` and `pip install onnxruntime-gpu==1.9.0`
Fibonacci134 commented 2022-05-30 18:06:30 +02:00 (Migrated from github.com)

Hey, you're using Onnxruntime-gpu version 1.9 or above. You need to set the execution provider. You may do this in the model zoo file located in your conda environment, or in your testvideoswapsingle.py file. I suggest making changes in the model zoo file. I believe i have uploaded a altered one on my github. Let us know if ykur issue is solved or close it please.

Hey, you're using Onnxruntime-gpu version 1.9 or above. You need to set the execution provider. You may do this in the model zoo file located in your conda environment, or in your testvideoswapsingle.py file. I suggest making changes in the model zoo file. I believe i have uploaded a altered one on my github. Let us know if ykur issue is solved or close it please.
acetony01 commented 2022-06-08 06:34:16 +02:00 (Migrated from github.com)

Hey, you're using Onnxruntime-gpu version 1.9 or above. You need to set the execution provider. You may do this in the model zoo file located in your conda environment, or in your testvideoswapsingle.py file. I suggest making changes in the model zoo file. I believe i have uploaded a altered one on my github. Let us know if ykur issue is solved or close it please.

Haven't had the chance to test it out yet. Will check if it solves the issue as soon as I can

> Hey, you're using Onnxruntime-gpu version 1.9 or above. You need to set the execution provider. You may do this in the model zoo file located in your conda environment, or in your testvideoswapsingle.py file. I suggest making changes in the model zoo file. I believe i have uploaded a altered one on my github. Let us know if ykur issue is solved or close it please. Haven't had the chance to test it out yet. Will check if it solves the issue as soon as I can
Sign in to join this conversation.