deepfakes / faceswap

Deepfakes Software For All
https://www.faceswap.dev
GNU General Public License v3.0
52.55k stars 13.24k forks source link

-LF option doesn't get carried to the internal tools #1377

Open tokafondo opened 8 months ago

tokafondo commented 8 months ago

Hi. I'm trying to use two faceswap instances in parallel. One of them is using GPU and I want to use the another one with only CPU for secondary tasks.

I use python faceswap.py gui -LF c:\temp\faceswap.log.2 -X0 to start the secondary instance.

When I try to run a sort task in this secondary instance, I get this:

Setting Faceswap backend to NVIDIA
Traceback (most recent call last):
File "C:\Users\Yo\faceswap\tools.py", line 48, in <module>
ARGUMENTS.func(ARGUMENTS)
File "C:\Users\Yo\faceswap\lib\cli\launcher.py", line 217, in execute_script
log_setup(arguments.loglevel, arguments.logfile, self._command, is_gui)
File "C:\Users\Yo\faceswap\lib\logger.py", line 375, in log_setup
f_handler = _file_handler(numeric_loglevel, log_file, log_format, command)
File "C:\Users\Yo\faceswap\lib\logger.py", line 419, in _file_handler
handler.doRollover()
File "C:\Users\Yo\miniconda3\envs\faceswap\lib\logging\handlers.py", line 179, in doRollover
self.rotate(self.baseFilename, dfn)
File "C:\Users\Yo\miniconda3\envs\faceswap\lib\logging\handlers.py", line 115, in rotate
os.rename(source, dest)
PermissionError: [WinError 32] El proceso no tiene acceso al archivo porque está siendo utilizado por otro proceso: 'C:\\Users\\Yo\\faceswap\\faceswap.log' -> 'C:\\Users\\Yo\\faceswap\\faceswap.log.1'
Process exited.

It seems that internally, it's still using the main log, because the -LF option doesn't get carried to the sort command.

If I run python.exe faceswap\tools.py sort -i C:/workspace.blade/Ford/Ford1 -s none -g face -t -1.0 -b 5 -lf sort_log.json -L INFO -LF c:\temp\faceswap.log.3 directly in the console, it works in parallel with the main instance.

tokafondo commented 8 months ago

[WinError 32] El proceso no tiene acceso al archivo porque está siendo utilizado por otro proceso: 'C:\\Users\\Yo\\faceswap\\faceswap.log' -> 'C:\\Users\\Yo\\faceswap\\faceswap.log.1'

This is spanish for The process cannot access the file because it is being used by another process