isl-org / OpenBot

OpenBot leverages smartphones as brains for low-cost robots. We have designed a small electric vehicle that costs about $50 and serves as a robot body. Our software stack for Android smartphones supports advanced robotics workloads such as person following and real-time autonomous navigation.
https://www.openbot.org
MIT License
2.82k stars 528 forks source link

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

Open sparta-2024 opened 1 month ago

sparta-2024 commented 1 month ago

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 tfpredictfunction 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):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

isha382 commented 3 weeks ago

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.