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

In some folders I am getting this error OverflowError: cannot convert float infinity to integer #18

Open
zubairahmed-ai opened this issue Oct 26, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@zubairahmed-ai
Copy link

Hi @rom1504

First of all thanks for the great work that you've done, I am facing this error is some of the folders that I am getting running similarity search in. Please help

 File "/home/cctvserver/Documents/Work/SimilaritySearch/Embeddings/image_embeddings-master/image_embeddings/inference/inference.py", line 92, in tfrecords_to_write_embeddings
    embeddings = images_to_embeddings(model, shard, batch_size)
  File "/home/cctvserver/Documents/Work/SimilaritySearch/Embeddings/image_embeddings-master/image_embeddings/inference/inference.py", line 119, in images_to_embeddings
    return model.predict(dataset.batch(batch_size).map(lambda image_raw, image_name: image_raw), verbose=1)
  File "/home/cctvserver/miniconda3/envs/tracker/lib/python3.8/site-packages/tensorflow/python/keras/engine/training.py", line 130, in _method_wrapper
    return method(self, *args, **kwargs)
  File "/home/cctvserver/miniconda3/envs/tracker/lib/python3.8/site-packages/tensorflow/python/keras/engine/training.py", line 1613, in predict
    callbacks.on_predict_end()
  File "/home/cctvserver/miniconda3/envs/tracker/lib/python3.8/site-packages/tensorflow/python/keras/callbacks.py", line 582, in on_predict_end
    callback.on_predict_end(logs)
  File "/home/cctvserver/miniconda3/envs/tracker/lib/python3.8/site-packages/tensorflow/python/keras/callbacks.py", line 979, in on_predict_end
    self._finalize_progbar(logs)
  File "/home/cctvserver/miniconda3/envs/tracker/lib/python3.8/site-packages/tensorflow/python/keras/callbacks.py", line 1026, in _finalize_progbar
    self.progbar.update(self.seen, list(logs.items()), finalize=True)
  File "/home/cctvserver/miniconda3/envs/tracker/lib/python3.8/site-packages/tensorflow/python/keras/utils/generic_utils.py", line 581, in update
    numdigits = int(np.log10(self.target)) + 1
OverflowError: cannot convert float infinity to integer
@rom1504
Copy link
Owner

rom1504 commented Oct 26, 2020

The error is saying that the data you give to the predict function is wrong in some way.
Can you try to print the value of the images before they are sent to predict function ?

@zubairahmed-ai
Copy link
Author

I noticed that it happens when data is too little, like 8 images. I have removed sharding because I am working with extremely little data
Also for the life of me I am struggling why would it cache the output of one script even if there is no sharding method anymore but it still keeps writing to terminal as if its writing them

Shard 0 done after 0s
Shard 0 saved after 0s
-1
-1
-1
-1
-1
-1
-1
-1

@rom1504 rom1504 added the enhancement New feature or request label May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants