OpenBot icon indicating copy to clipboard operation
OpenBot copied to clipboard

Input 0 of layer "dense_3" is incompatible with the layer

Open sparta-2024 opened this issue 1 year ago • 1 comments

Describe the bug A clear and concise description of what the bug is. tf_results = model.predict( ^^^^^^^^^^^^^^ File "d:\Users\anaconda3\Lib\site-packages\tf_keras\src\utils\traceback_utils.py", line 70, in error_handler raise e.with_traceback(filtered_tb) from None File "C:\Users\dd\AppData\Local\Temp_autograph_generated_filezo42g_5q.py", line 15, in tf__predict_function retval = ag__.converted_call(ag__.ld(step_function), (ag__.ld(self), ag__.ld(iterator)), None, fscope) ^^^^^ ValueError: in user code:

File "d:\Users\anaconda3\Lib\site-packages\tf_keras\src\engine\training.py", line 2436, in predict_function  *
    return step_function(self, iterator)
File "d:\Users\anaconda3\Lib\site-packages\tf_keras\src\engine\training.py", line 2421, in step_function  **
    outputs = model.distribute_strategy.run(run_step, args=(data,))
File "d:\Users\anaconda3\Lib\site-packages\tf_keras\src\engine\training.py", line 2409, in run_step  **
    outputs = model.predict_step(data)
File "d:\Users\anaconda3\Lib\site-packages\tf_keras\src\engine\training.py", line 2377, in predict_step
    return self(x, training=False)
File "d:\Users\anaconda3\Lib\site-packages\tf_keras\src\utils\traceback_utils.py", line 70, in error_handler
    raise e.with_traceback(filtered_tb) from None
File "d:\Users\anaconda3\Lib\site-packages\tf_keras\src\engine\input_spec.py", line 280, in assert_input_compatibility
    raise ValueError(

ValueError: Exception encountered when calling layer 'pilot_net' (type Functional).

Input 0 of layer "dense_3" is incompatible with the layer: expected axis -1 of input shape to have value 101, but received input with shape (None, 100)

Call arguments received by layer 'pilot_net' (type Functional):
  • inputs=('tf.Tensor(shape=(None, 96, 256, 3), dtype=float32)', 'tf.Tensor(shape=<unknown>, dtype=float32)')
  • training=False
  • mask=None

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. Windows, Linux, iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. Samsung S20]
  • OS: [e.g. Android 11]
  • Browser [e.g. stock browser, chrome]
  • Version [e.g. 0.1.1, master]

Additional context Add any other context about the problem here.

sparta-2024 avatar Aug 16 '24 15:08 sparta-2024

hi @sparta-2024, the issue is of the incompatibility with the version you can try with 2.9.0 version of tensorflow which is preferred version and can refer following documentation policy for more information.

isha382 avatar Aug 21 '24 09:08 isha382