Comments (12)
My refacer installation is based on much the same steps as for the roop install - is it all necessary? Not sure, but it already worked for roop and I found it also supported refacer:
- install visual studio 2022 with desktop development C++ and python development (not sure about python development)
- install cuda 11.7 (https://developer.nvidia.com/cuda-11-7-0-download-archive)
- download cudnn 8.9.1 for cuda 11.x https://developer.nvidia.com/rdp/cudnn-archive
- unpack cudnn over C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7 with replacement
- install python 3.10.x (any 3.10)
- download and install the last version of refacer
- pip install virtualenv
- virtualenv venv
- venv\scripts\activate.bat
- pip install torch torchvision torchaudio --force-reinstall --index-url https://download.pytorch.org/whl/cu118
- pip install -r requirements-GPU.txt
- Add ...\refacer-main\venv\Lib\site-packages\torch\lib to PATH (e.g., SET PATH=C:\refacer-main\venv\Lib\site-packages\torch\lib;%PATH%)
- SET CUDA_VISIBLE_DEVICES=x
That final step is unnecessary if you have a single GPU, but if you have multiple GPUs then set it to the ordinal of your desired card (e.g., 0, 1, . . .) and it will primarily use that GPU for supported operations.
They both use their respective venv environment and there have been no clashes/collisions.
thank you so much friend. now it worked. the only difference to you was the setting path. maybe that was the problem. 😀
from refacer.
better isolate environments with venv
or conda
, install many projects in same environment likely fails
from refacer.
can you please explain me how ? i dont know how to do. i am not a python expert.
from refacer.
google venv
for example
from refacer.
ok thanks, what is better conda or venv ?
from refacer.
u can start with venv
from refacer.
ok i got it to run with venv. but now i have the next problem. when i run it via a venv --system-site-packages, it wont use my gpu anymore.
can i force to use the gpu ?
`(refacer) C:\tools\refacer\refacer>python app.py
Trying FFMPEG h264_nvenc encoder
FFMPEG h264_nvenc encoder works
Video codec for FFMPEG: h264_nvenc
CPU mode with providers ['CPUExecutionProvider']
inswapper-shape: [1, 3, 128, 128]
Running on local URL: http://127.0.0.1:7860
To create a public link, set share=True
in launch()
.`
from refacer.
sorry to bother you. maybe i found the problem, why roop and refacer dont works parralel. i think refacer developer have some backed in path to onnxruntim in his python script to his own d:\ drive, look at the output error, there is a D:\a_work\ directory backed into the code:
"(refacer_env) C:\tools\refacer_env\refacer>python app.py
Trying FFMPEG h264_nvenc encoder
FFMPEG h264_nvenc encoder works
Video codec for FFMPEG: h264_nvenc
CUDA mode with providers ['CUDAExecutionProvider', 'CPUExecutionProvider']
EP Error D:\a_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:636 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasn't able to be loaded. Please install the correct version of CUDA and cuDNN as mentioned in the GPU requirements page (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements), make sure they're in the PATH, and that your GPU is supported.
when using ['CUDAExecutionProvider', 'CPUExecutionProvider']
Falling back to ['CUDAExecutionProvider', 'CPUExecutionProvider'] and retrying.
Traceback (most recent call last):
File "C:\tools\refacer_env\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 383, in init
self._create_inference_session(providers, provider_options, disabled_optimizers)
File "C:\tools\refacer_env\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 435, in _create_inference_session
sess.initialize_session(providers, provider_options, disabled_optimizers)
RuntimeError: D:\a_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:636 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasn't able to be loaded. Please install the correct version of CUDA and cuDNN as mentioned in the GPU requirements page (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements), make sure they're in the PATH, and that your GPU is supported.
from refacer.
D:\a_work\1\s\onnxruntime\python\...
is a mess generated by onnxruntime
, the devs never hard code any path in the scripts
from refacer.
My refacer installation is based on much the same steps as for the roop install - is it all necessary? Not sure, but it already worked for roop and I found it also supported refacer:
- install visual studio 2022 with desktop development C++ and python development (not sure about python development)
- install cuda 11.7 (https://developer.nvidia.com/cuda-11-7-0-download-archive)
- download cudnn 8.9.1 for cuda 11.x https://developer.nvidia.com/rdp/cudnn-archive
- unpack cudnn over C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7 with replacement
- install python 3.10.x (any 3.10)
- download and install the last version of refacer
- pip install virtualenv
- virtualenv venv
- venv\scripts\activate.bat
- pip install torch torchvision torchaudio --force-reinstall --index-url https://download.pytorch.org/whl/cu118
- pip install -r requirements-GPU.txt
- Add ...\refacer-main\venv\Lib\site-packages\torch\lib to PATH (e.g., SET PATH=C:\refacer-main\venv\Lib\site-packages\torch\lib;%PATH%)
- SET CUDA_VISIBLE_DEVICES=x
That final step is unnecessary if you have a single GPU, but if you have multiple GPUs then set it to the ordinal of your desired card (e.g., 0, 1, . . .) and it will primarily use that GPU for supported operations.
They both use their respective venv environment and there have been no clashes/collisions.
from refacer.
ok i will try this thank you
from refacer.
consider closing the issue if u r good
from refacer.
Related Issues (20)
- refacer web-interface uses same port as automatic1111 aka stable diffusion. HOT 1
- How can I increase the number of faces? HOT 1
- Error
- Doesn't recognise face from photo so doesnt swap. HOT 1
- Unable to determine which face was not detected
- The localhost doesn't work normally. HOT 5
- Error and doesn't work HOT 2
- Crashing at extracting frames. HOT 1
- (question for a friend) press reface but nothing appears in terminal HOT 2
- "CUDAExecutioner" In terminal missing after I accidentally uninstalled onnxruntime HOT 1
- Add option to use codeformer? HOT 1
- Option to swap to all faces? HOT 2
- I don't know what caused it, please help determine.
- Limitation Of a Video File? HOT 2
- numpy.core._exceptions._ArrayMemoryError
- Insightface Issue
- Hello, dnt work on colab HOT 2
- Issue HOT 2
- Error when creating a video
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from refacer.