kentaroy47 / frcnn-from-scratch-with-keras

:collision:Faster R-CNN from scratch written with Keras
Apache License 2.0
168 stars 106 forks source link

Test with images of different size #68

Open matheushent opened 4 years ago

matheushent commented 4 years ago

I'm trying to classify images of different size each other but I'm facing the following issue:

W tensorflow/core/common_runtime/base_collective_executor.cc:217] BaseCollectiveExecutor::StartAbort Invalid argument: input image must be of non-zero size [[{{node roi_pooling_conv_1/resize_3/ResizeBilinear}}]] Traceback (most recent call last): File "test_frcnn.py", line 175, in [P_cls, P_regr] = model_classifier.predict([F, ROIs]) File "/home/imagem/.local/lib/python3.6/site-packages/keras/engine/training.py", line 1462, in predict callbacks=callbacks) File "/home/imagem/.local/lib/python3.6/site-packages/keras/engine/training_arrays.py", line 324, in predict_loop batch_outs = f(ins_batch) File "/home/imagem/.local/lib/python3.6/site-packages/tensorflow_core/python/keras/backend.py", line 3727, in call outputs = self._graph_fn(*converted_inputs) File "/home/imagem/.local/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py", line 1551, in call return self._call_impl(args, kwargs) File "/home/imagem/.local/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py", line 1591, in _call_impl return self._call_flat(args, self.captured_inputs, cancellation_manager) File "/home/imagem/.local/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py", line 1692, in _call_flat ctx, args, cancellation_manager=cancellation_manager)) File "/home/imagem/.local/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py", line 545, in call ctx=ctx) File "/home/imagem/.local/lib/python3.6/site-packages/tensorflow_core/python/eager/execute.py", line 67, in quick_execute six.raise_from(core._status_to_exception(e.code, message), None) File "", line 3, in raise_from tensorflow.python.framework.errors_impl.InvalidArgumentError: input image must be of non-zero size [[node roi_pooling_conv_1/resize_3/ResizeBilinear (defined at /home/imagem/.local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:3009) ]] [Op:__inference_keras_scratch_graph_1354]

Function call stack: keras_scratch_graph

Any suggestion of what to do?

kentaroy47 commented 4 years ago

The script should resize the images to same size. I think you're trying to read a image where the path doesn't exist.

Or you may want to debug if the images are fed to the model (RPN and ROI) modules properly.

matheushent commented 4 years ago

I am not sure about read a image where the path doesn't exist. I pass a folder containing some images as an argument and the first image is classified correctly. The error appears next it.

I will debug as suggested by you.