Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`` throws error : erroneous infinity returned

See original GitHub issue

I am trying to run on a video of my own. The only modification made by me is for the path to the folder with the videos :

I have the same python and keras versions as mentioned in the readme.

The error trace:

Using TensorFlow backend.
2019-05-03 14:32:26.071187: I tensorflow/core/platform/] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Found 4 images belonging to 2 classes.
Predicted : [[0.99782073]] 
Real class : [1.]
Dealing with video
Traceback (most recent call last):
  File "/home/aneesh/Work/MesoNet/", line 31, in <module>
    predictions = compute_accuracy(classifier, '/home/aneesh/Work/data/deepfaketimit/DeepfakeTIMIT/')
  File "/home/aneesh/Work/MesoNet/", line 305, in compute_accuracy
    skipstep = max(floor(face_finder.length / frame_subsample_count), 0)
OverflowError: cannot convert float infinity to integer
Fatal Python error: could not acquire lock for <_io.BufferedReader name=8> at interpreter shutdown, possibly due to daemon threads

Thread 0x00007f08e77fe700 (most recent call first):
  File "/home/aneesh/SoftwareInstall/miniconda3/envs/lab_env/lib/python3.6/site-packages/imageio_ffmpeg/", line 61 in run
  File "/home/aneesh/SoftwareInstall/miniconda3/envs/lab_env/lib/python3.6/", line 916 in _bootstrap_inner
  File "/home/aneesh/SoftwareInstall/miniconda3/envs/lab_env/lib/python3.6/", line 884 in _bootstrap

Current thread 0x00007f0949657740 (most recent call first):
  File "/home/aneesh/SoftwareInstall/miniconda3/envs/lab_env/lib/python3.6/", line 1557 in _communicate
  File "/home/aneesh/SoftwareInstall/miniconda3/envs/lab_env/lib/python3.6/", line 863 in communicate
  File "/home/aneesh/SoftwareInstall/miniconda3/envs/lab_env/lib/python3.6/site-packages/imageio_ffmpeg/", line 193 in read_frames
  File "/home/aneesh/SoftwareInstall/miniconda3/envs/lab_env/lib/python3.6/site-packages/imageio/plugins/", line 342 in _close
  File "/home/aneesh/SoftwareInstall/miniconda3/envs/lab_env/lib/python3.6/site-packages/imageio/core/", line 252 in close
  File "/home/aneesh/SoftwareInstall/miniconda3/envs/lab_env/lib/python3.6/site-packages/imageio/core/", line 241 in __del__

I’ve tried debugging it. It seems to be stemming from

where face_finder.length is returning infinity.

I found a potential solution here :

I may have fixed it in my fork :

But on running it with this “fix”, I get 100% confidence of fakeness in real and fake videos. I suspect I’m doing something wrong.

Could you help me out @DariusAf


Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

markzampogloucommented, Jun 6, 2019

It seems the problem is linked to this bug:

The solution is probably to replace line 21 of Instead of self.length = self.container.get_length() put self.length = self.container.count_frames()

aneesh-joshicommented, Jun 6, 2019

@nviable makes sense. If @DariusAf could verify this change, I’ll make a PR and close this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

30. Errors and Exception Handling | Python Tutorial
In our example only one, i.e. "ValueError:". After having printed the text of the print statement, the execution does another loop. It starts ......
Read more >
Input contains NaN, infinity or a value too large for dtype ...
I have built an input matrix and I keep getting the following error. ValueError: Input contains NaN, infinity or a value too large...
Read more >
Exception and Error Handling in Python - DataCamp
As the name suggests, recursion error transpires when too many methods, one inside another is executed (one with an infinite recursion), which is...
Read more >
Python Exceptions (With Examples) - Programiz
In this tutorial, we will learn about exceptions in Python. We will cover exceptions and different types of exceptions in Python.
Read more >
Warning: unreachable code after return statement - JavaScript
When an expression exists after a valid return statement, a warning is given to indicate that the code after the return statement is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found