faceswap icon indicating copy to clipboard operation
faceswap copied to clipboard

Crash at extraction with latest pull

Open Kirin-kun opened this issue 8 years ago • 15 comments

It seems to crash when initializing the detector.

I tried with and without -A fan, with and without -mp and with mtcnn or dlib-cnn: same result.

It freezes a little while after the first traceback (freeze_support etc..) then the rest follows.

(faceenv) C:\Users\Kirin\faceswap>python c:\users\kirin\faceswap\faceswap.py ext
ract -i H:\Fakes\Tessa -o H:\Fakes\Tessa\aligned.mtcnn -A fan -D mtcnn -r on -mt
ms 100 -mp
Output Directory: H:\Fakes\Tessa\aligned.mtcnn
Input Directory: H:\Fakes\Tessa
Using json serializer
Alignments filepath: H:\Fakes\Tessa\alignments.json
Loading Detect from Mtcnn plugin...
Loading Align from Fan plugin...
Starting, this may take a while...
Initializing Face Alignment Network...
Initialized Face Alignment Network.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\program files\python36\Lib\multiprocessing\spawn.py", line 105, in sp
awn_main
    exitcode = _main(fd)
  File "c:\program files\python36\Lib\multiprocessing\spawn.py", line 115, in _m
ain
    self = reduction.pickle.load(from_parent)
  File "c:\users\kirin\faceswap\plugins\extract\detect\mtcnn.py", line 14, in <m
odule>
    from lib.multithreading import MultiThread
  File "c:\users\kirin\faceswap\lib\multithreading.py", line 62, in <module>
    queue_manager = QueueManager()
  File "c:\users\kirin\faceswap\lib\multithreading.py", line 16, in __init__
    self.manager = mp.Manager()
  File "c:\program files\python36\Lib\multiprocessing\context.py", line 56, in M
anager
    m.start()
  File "c:\program files\python36\Lib\multiprocessing\managers.py", line 513, in
 start
    self._process.start()
  File "c:\program files\python36\Lib\multiprocessing\process.py", line 105, in
start
    self._popen = self._Popen(self)
  File "c:\program files\python36\Lib\multiprocessing\context.py", line 322, in
_Popen
    return Popen(process_obj)
  File "c:\program files\python36\Lib\multiprocessing\popen_spawn_win32.py", lin
e 33, in __init__
    prep_data = spawn.get_preparation_data(process_obj._name)
  File "c:\program files\python36\Lib\multiprocessing\spawn.py", line 143, in ge
t_preparation_data
    _check_not_importing_main()
  File "c:\program files\python36\Lib\multiprocessing\spawn.py", line 136, in _c
heck_not_importing_main
    is not going to be frozen to produce an executable.''')
RuntimeError:
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.
Traceback (most recent call last):
  File "c:\users\kirin\faceswap\faceswap.py", line 36, in <module>
    ARGUMENTS.func(ARGUMENTS)
  File "c:\users\kirin\faceswap\lib\cli.py", line 81, in execute_script
    process.process()
  File "c:\users\kirin\faceswap\scripts\extract.py", line 48, in process
    self.run_extraction(save_thread)
  File "c:\users\kirin\faceswap\scripts\extract.py", line 110, in run_extraction

    self.plugins.launch_detector()
  File "c:\users\kirin\faceswap\scripts\extract.py", line 330, in launch_detecto
r
    raise ValueError("Error inititalizing Detector")
ValueError: Error inititalizing Detector
Process SpawnProcess-2:
Traceback (most recent call last):
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 312,
in _recv_bytes
    nread, err = ov.GetOverlappedResult(True)
Exception in thread Thread-2:
Traceback (most recent call last):
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 312,
in _recv_bytes
    nread, err = ov.GetOverlappedResult(True)
BrokenPipeError: [WinError 109] Le canal de communication a été fermé

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\program files\python36\Lib\threading.py", line 916, in _bootstrap_inn
er
    self.run()
  File "c:\program files\python36\Lib\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "c:\users\kirin\faceswap\scripts\extract.py", line 95, in save_faces
    item = save_queue.get()
  File "<string>", line 2, in get
  File "c:\program files\python36\Lib\multiprocessing\managers.py", line 757, in
 _callmethod
    kind, result = conn.recv()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 250,
in recv
    buf = self._recv_bytes()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 321,
in _recv_bytes
    raise EOFError
EOFError
BrokenPipeError: [WinError 109] Le canal de communication a été fermé


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
Exception in thread Thread-1:
Traceback (most recent call last):
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 312,
in _recv_bytes
    nread, err = ov.GetOverlappedResult(True)
BrokenPipeError: [WinError 109] Le canal de communication a été fermé

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\program files\python36\Lib\threading.py", line 916, in _bootstrap_inn
er
    self.run()
  File "c:\program files\python36\Lib\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "c:\users\kirin\faceswap\scripts\extract.py", line 74, in load_images
    load_queue.put((filename, image))
  File "<string>", line 2, in put
  File "c:\program files\python36\Lib\multiprocessing\managers.py", line 757, in
 _callmethod
    kind, result = conn.recv()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 250,
in recv
    buf = self._recv_bytes()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 321,
in _recv_bytes
    raise EOFError
EOFError
  File "c:\users\kirin\faceswap\plugins\extract\align\fan.py", line 56, in align

    item = self.queues["in"].get()

  File "<string>", line 2, in get
  File "c:\program files\python36\Lib\multiprocessing\managers.py", line 757, in
 _callmethod
    kind, result = conn.recv()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 250,
in recv
    buf = self._recv_bytes()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 321,
in _recv_bytes
    raise EOFError
EOFError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\program files\python36\Lib\multiprocessing\process.py", line 258, in
_bootstrap
    self.run()
  File "c:\program files\python36\Lib\multiprocessing\process.py", line 93, in r
un
    self._target(*self._args, **self._kwargs)
  File "c:\users\kirin\faceswap\plugins\extract\align\fan.py", line 64, in align

    item["exception"] = True
UnboundLocalError: local variable 'item' referenced before assignment

pip freeze: absl-py==0.2.2 astor==0.6.2 bleach==1.5.0 click==6.7 cloudpickle==0.5.3 cmake==3.11.0 cycler==0.10.0 dask==0.18.1 decorator==4.3.0 dlib==19.13.1 face-recognition==1.2.2 face-recognition-models==0.3.0 ffmpy==0.2.2 gast==0.2.0 grpcio==1.13.0 h5py==2.8.0 html5lib==0.9999999 Keras==2.2.4 Keras-Applications==1.0.6 Keras-Preprocessing==1.0.5 kiwisolver==1.0.1 Markdown==2.6.11 matplotlib==2.2.2 networkx==2.1 numpy==1.14.5 nvidia-ml-py3==7.352.0 opencv-python==3.4.1.15 pathlib==1.0.1 Pillow==5.1.0 protobuf==3.6.0 pyparsing==2.2.0 python-dateutil==2.7.3 pytz==2018.5 PyWavelets==0.5.2 PyYAML==3.12 scandir==1.7 scikit-image==0.14.0 scikit-learn==0.20.0 scipy==1.1.0 six==1.11.0 tensorboard==1.8.0 tensorflow-gpu==1.8.0 tensorflow-tensorboard==1.5.1 termcolor==1.1.0 toolz==0.9.0 tqdm==4.23.4 Werkzeug==0.14.1

Kirin-kun avatar Oct 27 '18 12:10 Kirin-kun

Hi Kirin-kun, I think it's the parameter "r ", it only works with degree specification and not with on or off. So -R 15, that's 15 degrees, you want multiple twists, then -R 1, 5, 15, 30, 45... Maybe you should study the help, "Python faceswap.py extract -H", should help also works with train, convert ....

TobiTrom avatar Oct 27 '18 13:10 TobiTrom

Ah. Maybe. It looks likes this parameter changed.

I'll test.

Kirin-kun avatar Oct 27 '18 13:10 Kirin-kun

Nope. I created a brand new virtualenv and this is the result:

(newface) C:\Users\Kirin\newface\Scripts>python c:\users\kirin\faceswap\faceswap
.py extract -i H:\Fakes\Tessa -o H:\Fakes\Tessa\aligned.mtcnn -A fan -D mtcnn -r
 15 -mtms 100 -mp
Output Directory: H:\Fakes\Tessa\aligned.mtcnn
Input Directory: H:\Fakes\Tessa
Using json serializer
Alignments filepath: H:\Fakes\Tessa\alignments.json
Loading Detect from Mtcnn plugin...
Loading Align from Fan plugin...
Starting, this may take a while...
Initializing Face Alignment Network...
Traceback (most recent call last):
  File "c:\users\kirin\faceswap\faceswap.py", line 36, in <module>
    ARGUMENTS.func(ARGUMENTS)
  File "c:\users\kirin\faceswap\lib\cli.py", line 81, in execute_script
    process.process()
  File "c:\users\kirin\faceswap\scripts\extract.py", line 48, in process
    self.run_extraction(save_thread)
  File "c:\users\kirin\faceswap\scripts\extract.py", line 109, in run_extraction

    self.plugins.launch_aligner()
  File "c:\users\kirin\faceswap\scripts\extract.py", line 302, in launch_aligner

    raise ValueError("Error inititalizing Aligner")
ValueError: Error inititalizing Aligner
Exception in thread Thread-1:
Traceback (most recent call last):
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 312,
in _recv_bytes
    nread, err = ov.GetOverlappedResult(True)
BrokenPipeError: [WinError 109] Le canal de communication a été fermé

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\program files\python36\Lib\threading.py", line 916, in _bootstrap_inn
er
    self.run()
  File "c:\program files\python36\Lib\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "c:\users\kirin\faceswap\scripts\extract.py", line 74, in load_images
    load_queue.put((filename, image))
  File "<string>", line 2, in put
  File "c:\program files\python36\Lib\multiprocessing\managers.py", line 757, in
 _callmethod
    kind, result = conn.recv()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 250,
in recv
    buf = self._recv_bytes()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 321,
in _recv_bytes
    raise EOFError
EOFError
Exception in thread Thread-2:
Traceback (most recent call last):
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 312,
in _recv_bytes
    nread, err = ov.GetOverlappedResult(True)
BrokenPipeError: [WinError 109] Le canal de communication a été fermé

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\program files\python36\Lib\threading.py", line 916, in _bootstrap_inn
er
    self.run()
  File "c:\program files\python36\Lib\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "c:\users\kirin\faceswap\scripts\extract.py", line 95, in save_faces
    item = save_queue.get()
  File "<string>", line 2, in get
  File "c:\program files\python36\Lib\multiprocessing\managers.py", line 757, in
 _callmethod
    kind, result = conn.recv()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 250,
in recv
    buf = self._recv_bytes()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 321,
in _recv_bytes
    raise EOFError
EOFError

Kirin-kun avatar Oct 27 '18 13:10 Kirin-kun

No, you can still use -r on.

It's called Windows being a massive pain in the ass with multiprocessing.

Will investigate asap.

torzdf avatar Oct 27 '18 16:10 torzdf

Ok, I've pushed a commit which should fix this as well as a couple of other minor bugfixes.

torzdf avatar Oct 27 '18 22:10 torzdf

Doesn't work it seems.

I'm not sure it's related, but the error changes according to the tensorflow-gpu version. I downgraded it from 1.11.0 to 1.8.0 and 1.6.0 and I obtain different errors.

With tensorflow-gpu-1.8.0, it seems to initialize the FAN, but crashes with something about "Op type not registered 'BytesLimit'" when initializing the detector.

With tensorflow-gpu-1.6.0, or the latest (1.11.0) it crashes earlier, as above, at "Initializing Face Alignment Network".

tensorflow-gpu==1.8.0

(faceenv) C:\Users\Kirin>python c:\users\kirin\faceswap\faceswap.py extract -i H
:\Fakes\Tessa -o H:\Fakes\Tessa\aligned.mtcnn -A fan -D mtcnn -r on -mtms 100 -m
p
Output Directory: H:\Fakes\Tessa\aligned.mtcnn
Input Directory: H:\Fakes\Tessa
Using json serializer
Alignments filepath: H:\Fakes\Tessa\alignments.json
Loading Detect from Mtcnn plugin...
Loading Align from Fan plugin...
Starting, this may take a while...
Initializing Face Alignment Network...
Initialized Face Alignment Network.
Initializing MTCNN Detector...
ERROR: Op type not registered 'BytesLimit' in binary running on UTENA. Make sure
 the Op and Kernel are registered in the binary running in this process. while b
uilding NodeDef 'BytesLimit'
Traceback (most recent call last):
  File "c:\users\kirin\faceswap\faceswap.py", line 36, in <module>
    ARGUMENTS.func(ARGUMENTS)
  File "c:\users\kirin\faceswap\lib\cli.py", line 81, in execute_script
    process.process()
  File "c:\users\kirin\faceswap\scripts\extract.py", line 47, in process
    self.run_extraction(save_thread)
  File "c:\users\kirin\faceswap\scripts\extract.py", line 109, in run_extraction

    self.plugins.launch_detector()
  File "c:\users\kirin\faceswap\scripts\extract.py", line 339, in launch_detecto
r
    raise ValueError("Error inititalizing Detector")
ValueError: Error inititalizing Detector
Process SpawnProcess-2:
Traceback (most recent call last):
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 312,
in _recv_bytes
    nread, err = ov.GetOverlappedResult(True)
Exception in thread Thread-2:
Traceback (most recent call last):
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 312,
in _recv_bytes
    nread, err = ov.GetOverlappedResult(True)
BrokenPipeError: [WinError 109] Le canal de communication a été fermé

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\program files\python36\Lib\threading.py", line 916, in _bootstrap_inn
er
    self.run()
  File "c:\program files\python36\Lib\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "c:\users\kirin\faceswap\scripts\extract.py", line 94, in save_faces
    item = save_queue.get()
  File "<string>", line 2, in get
  File "c:\program files\python36\Lib\multiprocessing\managers.py", line 757, in
 _callmethod
    kind, result = conn.recv()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 250,
in recv
    buf = self._recv_bytes()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 321,
in _recv_bytes
    raise EOFError
EOFError
BrokenPipeError: [WinError 109] Le canal de communication a été fermé
Exception in thread Thread-1:
Traceback (most recent call last):
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 312,
in _recv_bytes
    nread, err = ov.GetOverlappedResult(True)
BrokenPipeError: [WinError 109] Le canal de communication a été fermé

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\program files\python36\Lib\threading.py", line 916, in _bootstrap_inn
er
    self.run()
  File "c:\program files\python36\Lib\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "c:\users\kirin\faceswap\scripts\extract.py", line 73, in load_images
    load_queue.put((filename, image))
  File "<string>", line 2, in put
  File "c:\program files\python36\Lib\multiprocessing\managers.py", line 757, in
 _callmethod
    kind, result = conn.recv()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 250,
in recv
    buf = self._recv_bytes()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 321,
in _recv_bytes
    raise EOFError
EOFError


During handling of the above exception, another exception occurred:


Traceback (most recent call last):
  File "c:\users\kirin\faceswap\plugins\extract\align\fan.py", line 62, in align

    item = self.queues["in"].get()
  File "<string>", line 2, in get
  File "c:\program files\python36\Lib\multiprocessing\managers.py", line 757, in
 _callmethod
    kind, result = conn.recv()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 250,
in recv
    buf = self._recv_bytes()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 321,
in _recv_bytes
    raise EOFError
EOFError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\program files\python36\Lib\multiprocessing\process.py", line 258, in
_bootstrap
    self.run()
  File "c:\program files\python36\Lib\multiprocessing\process.py", line 93, in r
un
    self._target(*self._args, **self._kwargs)
  File "c:\users\kirin\faceswap\plugins\extract\align\fan.py", line 73, in align

    item["exception"] = True
UnboundLocalError: local variable 'item' referenced before assignment

With tensorflow-gpu==1.11.0 or 1.6.0:

(cface) C:\>python c:\users\kirin\faceswap\faceswap.py extract -i H:\Fakes\Tessa
 -o H:\Fakes\Tessa\aligned.mtcnn -A fan -D mtcnn -r on -mtms 100 -mp
Output Directory: H:\Fakes\Tessa\aligned.mtcnn
Input Directory: H:\Fakes\Tessa
Using json serializer
Alignments filepath: H:\Fakes\Tessa\alignments.json
Loading Detect from Mtcnn plugin...
Loading Align from Fan plugin...
Starting, this may take a while...
Initializing Face Alignment Network...
Traceback (most recent call last):
  File "c:\users\kirin\faceswap\faceswap.py", line 36, in <module>
    ARGUMENTS.func(ARGUMENTS)
  File "c:\users\kirin\faceswap\lib\cli.py", line 81, in execute_script
    process.process()
  File "c:\users\kirin\faceswap\scripts\extract.py", line 47, in process
    self.run_extraction(save_thread)
  File "c:\users\kirin\faceswap\scripts\extract.py", line 108, in run_extraction

    self.plugins.launch_aligner()
  File "c:\users\kirin\faceswap\scripts\extract.py", line 300, in launch_aligner

    raise ValueError("Error inititalizing Aligner")
ValueError: Error inititalizing Aligner
Exception in thread Thread-2:
Traceback (most recent call last):
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 312,
in _recv_bytes
    nread, err = ov.GetOverlappedResult(True)
BrokenPipeError: [WinError 109] Le canal de communication a été fermé

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\program files\python36\Lib\threading.py", line 916, in _bootstrap_inn
er
    self.run()
  File "c:\program files\python36\Lib\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "c:\users\kirin\faceswap\scripts\extract.py", line 94, in save_faces
    item = save_queue.get()
  File "<string>", line 2, in get
  File "c:\program files\python36\Lib\multiprocessing\managers.py", line 757, in
 _callmethod
    kind, result = conn.recv()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 250,
in recv
    buf = self._recv_bytes()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 321,
in _recv_bytes
    raise EOFError
EOFError
Exception in thread Thread-1:
Traceback (most recent call last):
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 312,
in _recv_bytes
    nread, err = ov.GetOverlappedResult(True)
BrokenPipeError: [WinError 109] Le canal de communication a été fermé

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\program files\python36\Lib\threading.py", line 916, in _bootstrap_inn
er
    self.run()
  File "c:\program files\python36\Lib\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "c:\users\kirin\faceswap\scripts\extract.py", line 73, in load_images
    load_queue.put((filename, image))
  File "<string>", line 2, in put
  File "c:\program files\python36\Lib\multiprocessing\managers.py", line 757, in
 _callmethod
    kind, result = conn.recv()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 250,
in recv
    buf = self._recv_bytes()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 321,
in _recv_bytes
    raise EOFError
EOFError

Kirin-kun avatar Oct 28 '18 07:10 Kirin-kun

Ok, we went through these exact issues in testing. You are correct that the first issue is a tensorflow version issue. The FAN model is saved into a protocol buffer, so taking it out will be a bit of a pain, I'll see if I can but otherwise I'll look to update TF requirements to >= 1.10

The second issue we found was because FAN is timing out during initialization (I'm assuming you had to wait 60 seconds before the error?). In our test instance this was because of the machine having multiple GPUs. Is this the case for you? Unfortunately I only have a single GPU so putting a fix in for this is tricky, but I'll see what we can do. In the interim could you please run again with tf1.11 and the -v flag so I can see the TF initialization messages.

Assuming you do have multiple GPUs, if you disable all GPUs except for the one you want to use, it should work.

torzdf avatar Oct 28 '18 09:10 torzdf

I only have a single GPU, a GTX 1060 6Gb.

It doesn't work, it times out during initialization of FAN:

With tensorflow-gpu==1.11.0:

(cface) C:\Users\Kirin\cface\Scripts>python c:\users\kirin\faceswap\faceswap.py
extract -i H:\Fakes\Tessa -o H:\Fakes\Tessa\aligned.mtcnn -A fan -D mtcnn -r on
-mtms 100 -mp -v
Output Directory: H:\Fakes\Tessa\aligned.mtcnn
Input Directory: H:\Fakes\Tessa
Using json serializer
Alignments filepath: H:\Fakes\Tessa\alignments.json
Loading Detect from Mtcnn plugin...
Loading Align from Fan plugin...
GeForce GTX 1060 6GB - 4718MB free of 6144MB
Starting, this may take a while...
Initializing Face Alignment Network...
Using device GeForce GTX 1060 6GB with 4718MB free of 6144MB
Reserving 2240MB for face alignments
Initializing Face Alignment Network model...
2018-10-28 12:47:54.016560: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1
411] Found device 0 with properties:
name: GeForce GTX 1060 6GB major: 6 minor: 1 memoryClockRate(GHz): 1.7715
pciBusID: 0000:01:00.0
totalMemory: 6.00GiB freeMemory: 4.55GiB
2018-10-28 12:47:54.029561: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1
490] Adding visible gpu devices: 0
Traceback (most recent call last):
  File "c:\users\kirin\faceswap\faceswap.py", line 36, in <module>
    ARGUMENTS.func(ARGUMENTS)
  File "c:\users\kirin\faceswap\lib\cli.py", line 81, in execute_script
    process.process()
  File "c:\users\kirin\faceswap\scripts\extract.py", line 47, in process
    self.run_extraction(save_thread)
  File "c:\users\kirin\faceswap\scripts\extract.py", line 108, in run_extraction

    self.plugins.launch_aligner()
  File "c:\users\kirin\faceswap\scripts\extract.py", line 300, in launch_aligner

    raise ValueError("Error inititalizing Aligner")
ValueError: Error inititalizing Aligner
Exception in thread Thread-2:
Traceback (most recent call last):
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 312,
in _recv_bytes
    nread, err = ov.GetOverlappedResult(True)
BrokenPipeError: [WinError 109] Le canal de communication a été fermé

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\program files\python36\Lib\threading.py", line 916, in _bootstrap_inn
er
    self.run()
  File "c:\program files\python36\Lib\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "c:\users\kirin\faceswap\scripts\extract.py", line 94, in save_faces
    item = save_queue.get()
  File "<string>", line 2, in get
  File "c:\program files\python36\Lib\multiprocessing\managers.py", line 757, in
 _callmethod
    kind, result = conn.recv()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 250,
in recv
    buf = self._recv_bytes()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 321,
in _recv_bytes
    raise EOFError
EOFError

Exception in thread Thread-1:
Traceback (most recent call last):
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 312,
in _recv_bytes
    nread, err = ov.GetOverlappedResult(True)
BrokenPipeError: [WinError 109] Le canal de communication a été fermé

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\program files\python36\Lib\threading.py", line 916, in _bootstrap_inn
er
    self.run()
  File "c:\program files\python36\Lib\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "c:\users\kirin\faceswap\scripts\extract.py", line 73, in load_images
    load_queue.put((filename, image))
  File "<string>", line 2, in put
  File "c:\program files\python36\Lib\multiprocessing\managers.py", line 757, in
 _callmethod
    kind, result = conn.recv()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 250,
in recv
    buf = self._recv_bytes()
  File "c:\program files\python36\Lib\multiprocessing\connection.py", line 321,
in _recv_bytes
    raise EOFError
EOFError

Kirin-kun avatar Oct 28 '18 11:10 Kirin-kun

And yes, after timing it, it timeouts at 60 seconds

Kirin-kun avatar Oct 28 '18 12:10 Kirin-kun

Ok, well that's annoying. We have it working on a GTX 1080 and a 1070Ti.

Just to eliminate the possibility that it is just taking a long time to initialize (I doubt it, mine inititalizes in under 10 seconds), could you edit the following line, and wait the 5 minutes to see if it times out again?

scripts/extract.py line 298 from:

        event.wait(60)

to:

        event.wait(300)

Either way I will look to get this fixed before it makes it's way to Master.

torzdf avatar Oct 28 '18 12:10 torzdf

It actually worked after setting event.wait to 300. It started to extract after 3/4 minutes.

But then, what's odd is that the following attempts, it took under 10 seconds. Even after reboot. So it was just the first time that took forever, for some unknown reason.

Is it compiling/converting/upgrading something the first time? And the next times, it doesn't need to?

It's the only logical explanation I have.

Kirin-kun avatar Oct 28 '18 13:10 Kirin-kun

Ok, that's good to know. I'll look to bump the default time-out and investigate the initial delay.

How are your speeds?

torzdf avatar Oct 28 '18 15:10 torzdf

Speed of extraction is pretty good. Better than before the addition of FAN actually. It initializes faster. When I pulled the commit (just before this issue), it downloaded a big file, so I guess a reference for FAN.

And this file was probably made for tf 1.8.0, because it took only a few seconds to initialize (but then it crashed later because of "Optype not registered.."), contrary to tf 1.6.0 or tf 1.11.0.

Other versions than 1.8.0 of tf must be doing something with it the first time, so it takes longer and blows the 60 secs timeout.

Kirin-kun avatar Oct 28 '18 15:10 Kirin-kun

I'll consider it solved.

Kirin-kun avatar Oct 28 '18 15:10 Kirin-kun

FYI: I converted the model myself using tf 1.10. I'm guessing there must be a bug in tf1.8.

Thanks for the feedback.

torzdf avatar Oct 28 '18 15:10 torzdf