Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OverflowError: cannot convert float infinity to integer #946

Open
bsisic opened this issue Dec 4, 2019 · 14 comments
Open

OverflowError: cannot convert float infinity to integer #946

bsisic opened this issue Dec 4, 2019 · 14 comments

Comments

@bsisic
Copy link

bsisic commented Dec 4, 2019

Got this crash report file when I run faceswap.py extract

Crash Report File


12/04/2019 13:18:53 MainProcess     MainThread      gpu_stats       get_vram                  DEBUG    GPU VRAM: [4080.0]
12/04/2019 13:18:53 MainProcess     MainThread      gpu_stats       __init__                  DEBUG    Initialized GPUStats
12/04/2019 13:18:53 MainProcess     MainThread      pipeline        _set_parallel_processing  DEBUG    Parallel processing disabled by amd
12/04/2019 13:18:53 MainProcess     MainThread      pipeline        _set_extractor_batchsize  DEBUG    Backend is not Nvidia. Not updating batchsize requirements
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   add_queue                 DEBUG    QueueManager adding: (name: 'extract_detect_in', maxsize: 1)
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   add_queue                 DEBUG    QueueManager added: (name: 'extract_detect_in')
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   get_queue                 DEBUG    QueueManager getting: 'extract_detect_in'
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   get_queue                 DEBUG    QueueManager got: 'extract_detect_in'
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   add_queue                 DEBUG    QueueManager adding: (name: 'extract_align_in', maxsize: 1)
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   add_queue                 DEBUG    QueueManager added: (name: 'extract_align_in')
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   get_queue                 DEBUG    QueueManager getting: 'extract_align_in'
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   get_queue                 DEBUG    QueueManager got: 'extract_align_in'
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   add_queue                 DEBUG    QueueManager adding: (name: 'extract_mask_in', maxsize: 1)
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   add_queue                 DEBUG    QueueManager added: (name: 'extract_mask_in')
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   get_queue                 DEBUG    QueueManager getting: 'extract_mask_in'
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   get_queue                 DEBUG    QueueManager got: 'extract_mask_in'
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   add_queue                 DEBUG    QueueManager adding: (name: 'extract_mask_out', maxsize: 1)
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   add_queue                 DEBUG    QueueManager added: (name: 'extract_mask_out')
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   get_queue                 DEBUG    QueueManager getting: 'extract_mask_out'
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   get_queue                 DEBUG    QueueManager got: 'extract_mask_out'
12/04/2019 13:18:53 MainProcess     MainThread      pipeline        _add_queues               DEBUG    Queues: {'extract_detect_in': <queue.Queue object at 0x151f72710>, 'extract_align_in': <queue.Queue object at 0x151f72eb8>, 'extract_mask_in': <queue.Queue object at 0x151f72f98>, 'extract_mask_out': <queue.Queue object at 0x151ea1438>}
12/04/2019 13:18:53 MainProcess     MainThread      pipeline        __init__                  DEBUG    Initialized Extractor
12/04/2019 13:18:53 MainProcess     MainThread      extract         __init__                  DEBUG    Initialized Extract
12/04/2019 13:18:53 MainProcess     MainThread      extract         process                   INFO     Starting, this may take a while...
12/04/2019 13:18:53 MainProcess     MainThread      extract         _threaded_redirector      DEBUG    Threading task: (Task: 'load')
12/04/2019 13:18:53 MainProcess     MainThread      multithreading  __init__                  DEBUG    Initializing MultiThread: (target: '_load', thread_count: 1)
12/04/2019 13:18:53 MainProcess     MainThread      multithreading  __init__                  DEBUG    Initialized MultiThread: '_load'
12/04/2019 13:18:53 MainProcess     MainThread      multithreading  start                     DEBUG    Starting thread(s): '_load'
12/04/2019 13:18:53 MainProcess     MainThread      multithreading  start                     DEBUG    Starting thread 1 of 1: '_load_0'
12/04/2019 13:18:53 MainProcess     _load_0         extract         _load                     DEBUG    Load Images: Start
12/04/2019 13:18:53 MainProcess     _load_0         image           load                      DEBUG    Initializing Load Generator
12/04/2019 13:18:53 MainProcess     _load_0         image           _set_thread               DEBUG    Setting thread
12/04/2019 13:18:53 MainProcess     _load_0         multithreading  __init__                  DEBUG    Initializing MultiThread: (target: 'ImagesLoader', thread_count: 1)
12/04/2019 13:18:53 MainProcess     _load_0         multithreading  __init__                  DEBUG    Initialized MultiThread: 'ImagesLoader'
12/04/2019 13:18:53 MainProcess     _load_0         image           _set_thread               DEBUG    Set thread: <lib.multithreading.MultiThread object at 0x151ea1240>
12/04/2019 13:18:53 MainProcess     _load_0         multithreading  start                     DEBUG    Starting thread(s): 'ImagesLoader'
12/04/2019 13:18:53 MainProcess     _load_0         multithreading  start                     DEBUG    Starting thread 1 of 1: 'ImagesLoader_0'
12/04/2019 13:18:53 MainProcess     MainThread      multithreading  start                     DEBUG    Started all threads '_load': 1
12/04/2019 13:18:53 MainProcess     MainThread      image           __init__                  DEBUG    Initializing ImagesSaver: (path: /Users/bsisic/localdev/R&D/faceswap/macron_faces, queue_size: 8, as_bytes: True)
12/04/2019 13:18:53 MainProcess     MainThread      image           __init__                  DEBUG    Initializing ImagesSaver: (path: /Users/bsisic/localdev/R&D/faceswap/macron_faces, queue_size: 8, args: None)
12/04/2019 13:18:53 MainProcess     ImagesLoader_0  image           _process                  DEBUG    Load iterator: <bound method ImagesLoader._from_folder of <lib.image.ImagesLoader object at 0x151bdd320>>
12/04/2019 13:18:53 MainProcess     ImagesLoader_0  image           _from_folder              DEBUG    Loading images from folder: '/Users/bsisic/localdev/R&D/faceswap/macron'. with_hash: False
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   get_queue                 DEBUG    QueueManager getting: 'ImagesSaver'
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   add_queue                 DEBUG    QueueManager adding: (name: 'ImagesSaver', maxsize: 8)
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   add_queue                 DEBUG    QueueManager added: (name: 'ImagesSaver')
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   get_queue                 DEBUG    QueueManager got: 'ImagesSaver'
12/04/2019 13:18:53 MainProcess     MainThread      pipeline        _launch_plugin            DEBUG    Launching detect plugin
12/04/2019 13:18:53 MainProcess     MainThread      pipeline        _launch_plugin            DEBUG    in_qname: extract_detect_in, out_qname: extract_align_in
12/04/2019 13:18:53 MainProcess     MainThread      _base           initialize                DEBUG    initialize Detect: (args: (), kwargs: {'in_queue': <queue.Queue object at 0x151f72710>, 'out_queue': <queue.Queue object at 0x151f72eb8>})
12/04/2019 13:18:53 MainProcess     MainThread      _base           initialize                INFO     Initializing S3FD (Detect)...
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   get_queue                 DEBUG    QueueManager getting: 'detect_predict'
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   add_queue                 DEBUG    QueueManager adding: (name: 'detect_predict', maxsize: 1)
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   add_queue                 DEBUG    QueueManager added: (name: 'detect_predict')
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   get_queue                 DEBUG    QueueManager got: 'detect_predict'
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   get_queue                 DEBUG    QueueManager getting: 'detect_post'
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   add_queue                 DEBUG    QueueManager adding: (name: 'detect_post', maxsize: 1)
12/04/2019 13:18:53 MainProcess     _load_0         multithreading  start                     DEBUG    Started all threads 'ImagesLoader': 1
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   add_queue                 DEBUG    QueueManager added: (name: 'detect_post')
12/04/2019 13:18:53 MainProcess     MainThread      queue_manager   get_queue                 DEBUG    QueueManager got: 'detect_post'
12/04/2019 13:18:53 MainProcess     MainThread      _base           _compile_threads          DEBUG    Compiling detect threads
12/04/2019 13:18:53 MainProcess     MainThread      _base           _add_thread               DEBUG    Adding thread: (name: detect_input, function: <bound method Detect.process_input of <plugins.extract.detect.s3fd.Detect object at 0x151bddeb8>>, in_queue: <queue.Queue object at 0x151f72710>, out_queue: <queue.Queue object at 0x151ea16d8>)
12/04/2019 13:18:53 MainProcess     MainThread      multithreading  __init__                  DEBUG    Initializing MultiThread: (target: 'detect_input', thread_count: 1)
12/04/2019 13:18:53 MainProcess     MainThread      multithreading  __init__                  DEBUG    Initialized MultiThread: 'detect_input'
12/04/2019 13:18:53 MainProcess     MainThread      _base           _add_thread               DEBUG    Added thread: detect_input
12/04/2019 13:18:53 MainProcess     MainThread      _base           _add_thread               DEBUG    Adding thread: (name: detect_predict, function: <bound method Detector._predict of <plugins.extract.detect.s3fd.Detect object at 0x151bddeb8>>, in_queue: <queue.Queue object at 0x151ea16d8>, out_queue: <queue.Queue object at 0x151ea17b8>)
12/04/2019 13:18:53 MainProcess     MainThread      multithreading  __init__                  DEBUG    Initializing MultiThread: (target: 'detect_predict', thread_count: 1)
12/04/2019 13:18:53 MainProcess     MainThread      multithreading  __init__                  DEBUG    Initialized MultiThread: 'detect_predict'
12/04/2019 13:18:53 MainProcess     MainThread      _base           _add_thread               DEBUG    Added thread: detect_predict
12/04/2019 13:18:53 MainProcess     MainThread      _base           _add_thread               DEBUG    Adding thread: (name: detect_output, function: <bound method Detect.process_output of <plugins.extract.detect.s3fd.Detect object at 0x151bddeb8>>, in_queue: <queue.Queue object at 0x151ea17b8>, out_queue: <queue.Queue object at 0x151f72eb8>)
12/04/2019 13:18:53 MainProcess     MainThread      multithreading  __init__                  DEBUG    Initializing MultiThread: (target: 'detect_output', thread_count: 1)
12/04/2019 13:18:53 MainProcess     MainThread      multithreading  __init__                  DEBUG    Initialized MultiThread: 'detect_output'
12/04/2019 13:18:53 MainProcess     MainThread      _base           _add_thread               DEBUG    Added thread: detect_output
12/04/2019 13:18:53 MainProcess     MainThread      _base           _compile_threads          DEBUG    Compiled detect threads: [<lib.multithreading.MultiThread object at 0x113e65710>, <lib.multithreading.MultiThread object at 0x151c88be0>, <lib.multithreading.MultiThread object at 0x151f8afd0>]
12/04/2019 13:18:53 MainProcess     MainThread      s3fd            __init__                  DEBUG    Initializing: S3fd: (model_path: '/Users/bsisic/localdev/R&D/faceswap/plugins/extract/detect/.cache/s3fd_keras_v1.h5', allow_growth: False)
12/04/2019 13:18:53 MainProcess     MainThread      session         load_model                VERBOSE  Initializing plugin model: S3FD
12/04/2019 13:18:53 MainProcess     MainThread      library         _logger_callback          INFO     Opening device "opencl_amd_radeon_pro_5500m_compute_engine.0"
12/04/2019 13:18:54 MainProcess     MainThread      s3fd            __init__                  DEBUG    Initialized: S3fd
12/04/2019 13:18:54 MainProcess     MainThread      _base           initialize                INFO     Initialized S3FD (Detect) with batchsize of 4
12/04/2019 13:18:54 MainProcess     MainThread      multithreading  start                     DEBUG    Starting thread(s): 'detect_input'
12/04/2019 13:18:54 MainProcess     MainThread      multithreading  start                     DEBUG    Starting thread 1 of 1: 'detect_input_0'
12/04/2019 13:18:54 MainProcess     detect_input_0  _base           _thread_process           DEBUG    threading: (function: 'process_input')
12/04/2019 13:18:54 MainProcess     MainThread      multithreading  start                     DEBUG    Started all threads 'detect_input': 1
12/04/2019 13:18:54 MainProcess     MainThread      multithreading  start                     DEBUG    Starting thread(s): 'detect_predict'
12/04/2019 13:18:54 MainProcess     MainThread      multithreading  start                     DEBUG    Starting thread 1 of 1: 'detect_predict_0'
12/04/2019 13:18:54 MainProcess     detect_predict_0 _base           _thread_process           DEBUG    threading: (function: '_predict')
12/04/2019 13:18:54 MainProcess     MainThread      multithreading  start                     DEBUG    Started all threads 'detect_predict': 1
12/04/2019 13:18:54 MainProcess     MainThread      multithreading  start                     DEBUG    Starting thread(s): 'detect_output'
12/04/2019 13:18:54 MainProcess     MainThread      multithreading  start                     DEBUG    Starting thread 1 of 1: 'detect_output_0'
12/04/2019 13:18:54 MainProcess     detect_output_0 _base           _thread_process           DEBUG    threading: (function: 'process_output')
12/04/2019 13:18:54 MainProcess     MainThread      multithreading  start                     DEBUG    Started all threads 'detect_output': 1
12/04/2019 13:18:54 MainProcess     MainThread      pipeline        _launch_plugin            DEBUG    Launched detect plugin
12/04/2019 13:18:54 MainProcess     MainThread      pipeline        detected_faces            DEBUG    Running Detection. Phase: 'detect'
12/04/2019 13:19:17 MainProcess     detect_output_0 multithreading  run                       DEBUG    Error in thread (detect_output_0): cannot convert float infinity to integer
12/04/2019 13:19:17 MainProcess     MainThread      multithreading  check_and_raise_error     DEBUG    Thread error caught: [(<class 'OverflowError'>, OverflowError('cannot convert float infinity to integer'), <traceback object at 0x151d53148>)]
12/04/2019 13:19:18 MainProcess     MainThread      plaidml_tools   initialize                DEBUG    PlaidML already initialized
12/04/2019 13:19:18 MainProcess     MainThread      plaidml_tools   get_supported_devices     DEBUG    []
12/04/2019 13:19:18 MainProcess     MainThread      plaidml_tools   get_all_devices           DEBUG    Experimental Devices: [<plaidml._DeviceConfig object at 0x158309898>]
12/04/2019 13:19:18 MainProcess     MainThread      plaidml_tools   get_all_devices           DEBUG    [<plaidml._DeviceConfig object at 0x158309898>]
12/04/2019 13:19:18 MainProcess     MainThread      plaidml_tools   __init__                  DEBUG    Initialized: PlaidMLStats
12/04/2019 13:19:18 MainProcess     MainThread      plaidml_tools   supported_indices         DEBUG    []
Traceback (most recent call last):
  File "/Users/bsisic/localdev/R&D/faceswap/lib/cli.py", line 128, in execute_script
    process.process()
  File "/Users/bsisic/localdev/R&D/faceswap/scripts/extract.py", line 115, in process
    self._run_extraction()
  File "/Users/bsisic/localdev/R&D/faceswap/scripts/extract.py", line 210, in _run_extraction
    for idx, extract_media in enumerate(status_bar):
  File "/Users/bsisic/localdev/R&D/faceswap/plaidml-venv/lib/python3.7/site-packages/tqdm/std.py", line 1097, in __iter__
    for obj in iterable:
  File "/Users/bsisic/localdev/R&D/faceswap/plugins/extract/pipeline.py", line 211, in detected_faces
    if self._check_and_raise_error():
  File "/Users/bsisic/localdev/R&D/faceswap/plugins/extract/pipeline.py", line 476, in _check_and_raise_error
    if plugin.check_and_raise_error():
  File "/Users/bsisic/localdev/R&D/faceswap/plugins/extract/_base.py", line 296, in check_and_raise_error
    err = thread.check_and_raise_error()
  File "/Users/bsisic/localdev/R&D/faceswap/lib/multithreading.py", line 84, in check_and_raise_error
    raise error[1].with_traceback(error[2])
  File "/Users/bsisic/localdev/R&D/faceswap/lib/multithreading.py", line 37, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/bsisic/localdev/R&D/faceswap/plugins/extract/_base.py", line 424, in _thread_process
    for item in self.finalize(batch):
  File "/Users/bsisic/localdev/R&D/faceswap/plugins/extract/detect/_base.py", line 157, in finalize
    for faces in batch["prediction"]]
  File "/Users/bsisic/localdev/R&D/faceswap/plugins/extract/detect/_base.py", line 157, in <listcomp>
    for faces in batch["prediction"]]
  File "/Users/bsisic/localdev/R&D/faceswap/plugins/extract/detect/_base.py", line 156, in <listcomp>
    for face in faces]
  File "/Users/bsisic/localdev/R&D/faceswap/plugins/extract/detect/_base.py", line 194, in to_detected_face
    y=int(round(top)),

last line :

-> OverflowError: cannot convert float infinity to integer

@greg-amato
Copy link

Same deal. I've attached my log file as well.
crash_report.2019.12.14.132632110976.log

@torzdf
Copy link
Collaborator

torzdf commented Dec 14, 2019

If anyone is able to provide a source that this occurs for, then it will help with diagnosing.

@bsisic
Copy link
Author

bsisic commented Dec 14, 2019

that was about a miss configuration for me
solved with a new virtualenv faceswap_env/ 😞

@AB19
Copy link

AB19 commented Dec 20, 2019

@bsisic hi, im facing the same issue. can you please elaborate on what the missed configuration was.

TIA!

@chenyangguang
Copy link

chenyangguang commented Dec 29, 2019

@AbysmalBiscuit

I have the same problem too.
Mac sys.
Python 3.7.4
And I run in a virtual environment tool by using pip3.

My solution way is try for the absolute directory. And it does works well !
May be you should try for ab dir rather than relatively dir. Good luck.

@torzdf
Copy link
Collaborator

torzdf commented Dec 31, 2019

As I said before, I cannot diagnose this bug without a source video that fails. If anyone can provide a video that causes this failure I can look into it

@AB19
Copy link

AB19 commented Dec 31, 2019

Hi guys,

I was able to fix the issue by changing the detector to 'cv2-dnn'.

command that works for me: python3.7 faceswap.py extract -D cv2-dnn -i input_folder -o output_folder

@torzdf next time i encounter this bug, i will make sure to create a video and share it with you.

Thanks!

@torzdf
Copy link
Collaborator

torzdf commented Jan 10, 2020

Ok, I have been provided with a video, but cannot recreate this bug....

My next request is for a full TRACE log.

If you encounter this issue, then please set loglevel to TRACE and provide the full trace report. Note that the process will run slower and the log is likely to be huge.

@angonyfox
Copy link

I have same problem too.

Environment

  • Mac OS 10.15.3
  • Python 3.6.9
  • Detector: S3Fd

Already test with these setting but still not working

  • use absolute directory
  • change input source
    • another video
    • use image directory as input source

https://mega.nz/#!jRs3HDhS!wT2h-TTUS02XsXswhnRSe5qZoikz4T1-GuIsqnbWbK8

crash_report.2020.02.25.123103291503.log

@sunbaigui
Copy link

@torzdf 考虑阿里人脸识别机会的话,邮件baigui.sbg@alibaba-inc.com,我是直接用人主管。

@eboye
Copy link

eboye commented Apr 22, 2020

Change the detector from S3Fd to cv2-dnn and it passes. S3Fd for some reason is not working.

@Knowledge-l
Copy link

File "D:\develop\Anaconda3\envs\faceswap\lib\site-packages\keras\engine\base_layer.py", line 285, in assert_input_compatibility
str(inputs) + '. All inputs to the layer '
ValueError: Layer LAYER_44 was called with an input that isn't a symbolic tensor. Received type: <class 'theano.tensor.var.TensorConstant'>. Full input: [Elemwise{mul,no_inplace}.0, TensorConstant{2.0}]. All inputs to the layer should be tensors.
crash_report.2020.05.07.190935881586.log

@HyperSimon
Copy link

S3Fd for some reason is not working. +1
No matter what video is used, it is the same error👇
OverflowError: cannot convert float infinity to integer

@LemonCANDY42
Copy link

LemonCANDY42 commented Jul 27, 2021

Traceback (most recent call last):
File "D:\faceswap\lib\cli\launcher.py", line 182, in execute_script
process.process()
File "D:\faceswap\scripts\extract.py", line 119, in process
self._run_extraction()
File "D:\faceswap\scripts\extract.py", line 216, in _run_extraction
for idx, extract_media in enumerate(status_bar):
File "C:\Users\LWRF4\anaconda3\envs\faceswap\lib\site-packages\tqdm\std.py", line 1185, in iter
for obj in iterable:
File "D:\faceswap\plugins\extract\pipeline.py", line 239, in detected_faces
if self._check_and_raise_error():
File "D:\faceswap\plugins\extract\pipeline.py", line 662, in _check_and_raise_error
if plugin.check_and_raise_error():
File "D:\faceswap\plugins\extract_base.py", line 347, in check_and_raise_error
err = thread.check_and_raise_error()
File "D:\faceswap\lib\multithreading.py", line 84, in check_and_raise_error
raise error[1].with_traceback(error[2])
File "D:\faceswap\lib\multithreading.py", line 37, in run
self._target(*self._args, **self._kwargs)
File "D:\faceswap\plugins\extract_base.py", line 480, in _thread_process
for item in self.finalize(batch):
File "D:\faceswap\plugins\extract\detect_base.py", line 160, in finalize
batch_faces = [[self.to_detected_face(face[0], face[1], face[2], face[3])
File "D:\faceswap\plugins\extract\detect_base.py", line 160, in
batch_faces = [[self.to_detected_face(face[0], face[1], face[2], face[3])
File "D:\faceswap\plugins\extract\detect_base.py", line 160, in
batch_faces = [[self.to_detected_face(face[0], face[1], face[2], face[3])
File "D:\faceswap\plugins\extract\detect_base.py", line 197, in to_detected_face
return DetectedFace(x=int(round(left)),
👇
OverflowError: cannot convert float infinity to integer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests