DeepFaceLab icon indicating copy to clipboard operation
DeepFaceLab copied to clipboard

XSeg error when trying to apply masks

Open JapaTuts opened this issue 4 years ago • 7 comments
trafficstars

I've already made the face path in XSeg editor and trained it But now when I try to exectue the file 5.XSeg) data_dst trained mask - apply or 5.XSeg) data_src trained mask - apply the CMD returns this to me

Applying trained XSeg model to aligned/ folder. Traceback (most recent call last): File "D:\.Arquivos\Programs\DFL\DeepFaceLab_NVIDIA\_internal\DeepFaceLab\main.py", line 324, in <module> arguments.func(arguments) File "D:\.Arquivos\Programs\DFL\DeepFaceLab_NVIDIA\_internal\DeepFaceLab\main.py", line 285, in process_xsegapply XSegUtil.apply_xseg (Path(arguments.input_dir), Path(arguments.model_dir)) File "D:\.Arquivos\Programs\DFL\DeepFaceLab_NVIDIA\_internal\DeepFaceLab\mainscripts\XSegUtil.py", line 32, in apply_xseg raise_on_no_model_files=True) File "D:\.Arquivos\Programs\DFL\DeepFaceLab_NVIDIA\_internal\DeepFaceLab\facelib\XSegNet.py", line 73, in __init__ raise Exception(f'{model_file_path} does not exists.') Exception: D:\.Arquivos\Programs\DFL\DeepFaceLab_NVIDIA\workspace\model\XSeg_256.npy does not exists.

I've checked and the file XSeg_256.npy actually exists on the path, so I don't really know where is the bug

JapaTuts avatar Jan 26 '21 01:01 JapaTuts

I'm having the same problem: Applying trained XSeg model to aligned/ folder. Traceback (most recent call last): File "F:\DeepFake\DeepFaceLab\DeepFaceLab_NVIDIA\_internal\DeepFaceLab\main.py", line 324, in <module> arguments.func(arguments) File "F:\DeepFake\DeepFaceLab\DeepFaceLab_NVIDIA\_internal\DeepFaceLab\main.py", line 285, in process_xsegapply XSegUtil.apply_xseg (Path(arguments.input_dir), Path(arguments.model_dir)) File "F:\DeepFake\DeepFaceLab\DeepFaceLab_NVIDIA\_internal\DeepFaceLab\mainscripts\XSegUtil.py", line 32, in apply_xseg raise_on_no_model_files=True) File "F:\DeepFake\DeepFaceLab\DeepFaceLab_NVIDIA\_internal\DeepFaceLab\facelib\XSegNet.py", line 73, in __init__ raise Exception(f'{model_file_path} does not exists.') Exception: F:\DeepFake\DeepFaceLab\DeepFaceLab_NVIDIA\workspace\model\XSeg_256.npy does not exists.

fhrancis avatar Jan 30 '21 02:01 fhrancis

also having this error (using deepfacelab_linux)

j-mir-prazak avatar Feb 06 '21 09:02 j-mir-prazak

I have the same problem when using CPU to do XSeg apply, if you use CPU, you should change the code of the file "_internal\DeepFaceLab\mainscripts\XSegUtil.py",

from

    xseg = XSegNet(name='XSeg', 
                    load_weights=True,
                    weights_file_root=model_path,
                    data_format=nn.data_format,
                    raise_on_no_model_files=True)

to

    xseg = XSegNet(name='XSeg', 
                    load_weights=True,
                    weights_file_root=model_path,
                    data_format=nn.data_format,
                    place_model_on_cpu=True,
                    run_on_cpu=True,
                    raise_on_no_model_files=True)

this is because XSegUtil.py does not check whether you use CPU or not, and by default the code use GPU to load model, when load model fail, the exception will tell you the model does not exist, even though the model file exists.

minixalpha avatar Feb 23 '21 09:02 minixalpha

Rollback to a previous commit, the last one from May 12, 2021 is giving this error

darkrubiks avatar May 19 '21 15:05 darkrubiks

Rollback to a previous commit, the last one from May 12, 2021 is giving this error

Has anyone found a solution to this? This is my traceback:

Traceback (most recent call last):
File "C:\DeepFaceLab_NVIDIA_RTX3000_series\_internal\DeepFaceLab\main.py", line 343, in <module>
arguments.func(arguments)
File "C:\DeepFaceLab_NVIDIA_RTX3000_series\_internal\DeepFaceLab\main.py", line 304, in process_xsegapply
XSegUtil.apply_xseg (Path(arguments.input_dir), Path(arguments.model_dir))
File "C:\DeepFaceLab_NVIDIA_RTX3000_series\_internal\DeepFaceLab\mainscripts\XSegUtil.py", line 57, in apply_xseg
raise_on_no_model_files=True)
File "C:\DeepFaceLab_NVIDIA_RTX3000_series\_internal\DeepFaceLab\facelib\XSegNet.py", line 73, in __init__
raise Exception(f'{model_file_path} does not exists.')
Exception: C:\DeepFaceLab_NVIDIA_RTX3000_series\workspace\model\XSeg_256.npy does not exists.

I'm on Windows 10, running on GPU.

Zeesy avatar Sep 02 '22 15:09 Zeesy

Rollback to a previous commit, the last one from May 12, 2021 is giving this error

Has anyone found a solution to this? This is my traceback:

Traceback (most recent call last):
File "C:\DeepFaceLab_NVIDIA_RTX3000_series\_internal\DeepFaceLab\main.py", line 343, in <module>
arguments.func(arguments)
File "C:\DeepFaceLab_NVIDIA_RTX3000_series\_internal\DeepFaceLab\main.py", line 304, in process_xsegapply
XSegUtil.apply_xseg (Path(arguments.input_dir), Path(arguments.model_dir))
File "C:\DeepFaceLab_NVIDIA_RTX3000_series\_internal\DeepFaceLab\mainscripts\XSegUtil.py", line 57, in apply_xseg
raise_on_no_model_files=True)
File "C:\DeepFaceLab_NVIDIA_RTX3000_series\_internal\DeepFaceLab\facelib\XSegNet.py", line 73, in __init__
raise Exception(f'{model_file_path} does not exists.')
Exception: C:\DeepFaceLab_NVIDIA_RTX3000_series\workspace\model\XSeg_256.npy does not exists.

I'm on Windows 10, running on GPU.

Solution for me - I needed to move my frames from the worskspace > data_src > frames folder I created to worskspace > data_src and everything worked fine.

Zeesy avatar Sep 04 '22 18:09 Zeesy

My Solution:

I placed the files 'XSeg_256.npy', 'XSeg_data.dat', and 'XSeg_summary.txt' in the 'workspace/model' directory and I was able to run '5_XSeg_data_dst_mask_apply.sh' successfully.

On Ubuntu 20.04

yhsharaf avatar Apr 16 '23 08:04 yhsharaf

Issue solved / already answered (or it seems like user error), please close it.

joolstorrentecalo avatar Jun 08 '23 22:06 joolstorrentecalo