nicknochnack / FaceDetection

An end-to-end walkthrough with a custom object detection pipeline for face detection!
156 stars 117 forks source link

ValueError: Cannot take the length of shape with unknown rank. #5

Open gandrabharadhwaj01 opened 4 months ago

gandrabharadhwaj01 commented 4 months ago

Epoch 1/10

ValueError Traceback (most recent call last) Cell In[70], line 1 ----> 1 hist = model.fit(train, epochs=10, validation_data=val, callbacks=[tensorboard_callback])

File ~\anaconda3\Lib\site-packages\keras\src\utils\traceback_utils.py:122, in filter_traceback..error_handler(*args, **kwargs) 119 filtered_tb = _process_traceback_frames(e.traceback) 120 # To get the full stack trace, call: 121 # keras.config.disable_traceback_filtering() --> 122 raise e.with_traceback(filtered_tb) from None 123 finally: 124 del filtered_tb

Cell In[65], line 19, in FaceTracker.train_step(self, batch, *kwargs) 16 with tf.GradientTape() as tape: 17 classes, coords = self.model(X, training=True) ---> 19 batch_classloss = self.closs(y[0], classes) 20 batch_localizationloss = self.lloss(tf.cast(y[1], tf.float32), coords) 22 total_loss = batch_localizationloss+0.5batch_classloss

ValueError: Cannot take the length of shape with unknown rank.

ps3460 commented 3 months ago

I'm getting the same

Epoch 1/10

ValueError Traceback (most recent call last) Cell In[167], line 1 ----> 1 hist = model.fit(train, epochs=10, validation_data=val, callbacks=[tensorboard_callback])

File /opt/anaconda3/lib/python3.11/site-packages/keras/src/utils/traceback_utils.py:122, in filter_traceback..error_handler(*args, **kwargs) 119 filtered_tb = _process_traceback_frames(e.traceback) 120 # To get the full stack trace, call: 121 # keras.config.disable_traceback_filtering() --> 122 raise e.with_traceback(filtered_tb) from None 123 finally: 124 del filtered_tb

Cell In[160], line 19, in FaceTracker.train_step(self, batch, *kwargs) 16 with tf.GradientTape() as tape: 17 classes, coords = self.model(X, training=True) ---> 19 batch_classloss = self.closs(y[0], classes) 20 batch_localizationloss = self.lloss(tf.cast(y[1], tf.float32), coords) 22 total_loss = batch_localizationloss+0.5batch_classloss

ValueError: Cannot take the length of shape with unknown rank.****

daiddjdj commented 2 months ago

i am facing the same error sir could tell me how to fix it

daiddjdj commented 2 months ago
Screenshot 2024-06-16 104405
hermanumrao commented 2 months ago

https://github.com/nicknochnack/FaceDetection/issues/4#issuecomment-2068771352

pls check this out

it worked for me

kavin-raja-d commented 1 month ago

error Even i also getting same error.