FurkanOM / tf-faster-rcnn

Tensorflow 2 Faster-RCNN implementation from scratch supporting to the batch processing with MobileNetV2 and VGG16 backbones
Apache License 2.0
94 stars 61 forks source link

Error occurred when finalizing GeneratorDataset iterator #26

Open mateuszusd opened 1 year ago

mateuszusd commented 1 year ago

WARNING:tensorflow:input_shape is undefined or non-square, or rows is not in [96, 128, 160, 192, 224]. Weights for input shape (224, 224) will be loaded as the default. WARNING:tensorflow:input_shape is undefined or non-square, or rows is not in [96, 128, 160, 192, 224]. Weights for input shape (224, 224) will be loaded as the default. Epoch 1/2 Traceback (most recent call last): File "C:/Users/SV60002880/Desktop/FRCNN/rpn_trainer.py", line 66, in rpn_model.fit(rpn_train_feed, File "D:\anaconda\envs\CPU\lib\site-packages\tensorflow\python\keras\engine\training.py", line 66, in _method_wrapper return method(self, *args, kwargs) File "D:\anaconda\envs\CPU\lib\site-packages\tensorflow\python\keras\engine\training.py", line 848, in fit tmp_logs = train_function(iterator) File "D:\anaconda\envs\CPU\lib\site-packages\tensorflow\python\eager\def_function.py", line 580, in call result = self._call(*args, *kwds) File "D:\anaconda\envs\CPU\lib\site-packages\tensorflow\python\eager\def_function.py", line 644, in _call return self._stateless_fn(args, kwds) File "D:\anaconda\envs\CPU\lib\site-packages\tensorflow\python\eager\function.py", line 2420, in call return graph_function._filtered_call(args, kwargs) # pylint: disable=protected-access File "D:\anaconda\envs\CPU\lib\site-packages\tensorflow\python\eager\function.py", line 1661, in _filtered_call return self._call_flat( File "D:\anaconda\envs\CPU\lib\site-packages\tensorflow\python\eager\function.py", line 1745, in _call_flat return self._build_call_outputs(self._inference_function.call( File "D:\anaconda\envs\CPU\lib\site-packages\tensorflow\python\eager\function.py", line 593, in call outputs = execute.execute( File "D:\anaconda\envs\CPU\lib\site-packages\tensorflow\python\eager\execute.py", line 59, in quick_execute tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name, tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [4,9216] vs. [4] [[node reg_loss/mul (defined at C:\Users\SV60002880\Desktop\FRCNN\utils\train_utils.py:223) ]] [Op:__inference_train_function_14590]

Errors may have originated from an input operation. Input Source operations connected to node reg_loss/mul: reg_loss/Cast (defined at C:\Users\SV60002880\Desktop\FRCNN\utils\train_utils.py:221)
reg_loss/Sum (defined at C:\Users\SV60002880\Desktop\FRCNN\utils\train_utils.py:218)

Function call stack: train_function

how to solve it