While running this notebook, im getting the following error while fitting data to model:
InvalidArgumentError: logits and labels must be broadcastable: logits_size=[32,3] labels_size=[32,4]
[[node loss/dense_10_loss/softmax_cross_entropy_with_logits (defined at //anaconda3/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py:1751) ]] [Op:__inference_distributed_function_7050]
Function call stack:
distributed_function
@geek I trust you have two folders train and Val?, If yes will try uploaded my splitted folders on Google n run the code on colab then make it shareable.
https://github.com/kongkip/Detect_Diseases_on_Wheat_Crop
there is a problem with this code , when i try to map val_list_ds/test_list_ds it tells me "Tensor' object has no attribute 'to_sparse' "
While running this notebook, im getting the following error while fitting data to model:
InvalidArgumentError: logits and labels must be broadcastable: logits_size=[32,3] labels_size=[32,4] [[node loss/dense_10_loss/softmax_cross_entropy_with_logits (defined at //anaconda3/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py:1751) ]] [Op:__inference_distributed_function_7050] Function call stack: distributed_function
Any idea how I can resolve this?
@shadab96 check the train folder that it doesn't have an extra folder or file. Assert that it's only leaf_rust, stem_rust and healthy_wheat
Make sure you have provided a correct file path
With what ratio you have splitted the data for training and validation?
Did you augmented images for all the categories given in training dataset?
.9 training .1 for validation
and i didn't use data augmentation
I first augmented the data on the train folder the splitted to a ratio of 0.8 to 0.2
i did the same as you but the problem keeps persisting:
@geek I trust you have two folders train and Val?, If yes will try uploaded my splitted folders on Google n run the code on colab then make it shareable.
Hi @geek I have got the same error with tensorflow 2.1 was using tensorflow 2.0, will try fix the issue then will update.
thank you for your response , i tried to fix the problem by adding parameters but it didn't work ,
i hope you make an update for the notbook :)
https://www.kaggle.com/kongaevans/detect-diseases-on-wheat?scriptVersionId=28444628, check out this notebook on Kaggle.
thak you :)