keras-team/keras

ValueError: (F1Score|FBetaScore) expects 2D inputs with shape (batch_size, output_dim).

msusol opened this issue · 2 comments

          > I was facing a different error while executing the mentioned code.

@tilakrayal

I will show the pip list installed so my code would work in TF 2.16.1. I know I was running into an issue with datasets and had to downgrade.

See also https://www.kaggle.com/datasets/gdataranger/tf2-16-requirements-txt

# Following is based on https://github.com/huggingface/datasets/issues/6753#issuecomment-2027906687
!pip install -U datasets==2.16.0
!pip install -U fsspec==2023.10.0
!pip install -U gcsfs==2023.10.0
!pip install -U keras==3.0.5
!pip install -U ml-dtypes==0.3.2
!pip install -U numpy==1.26.4
!pip install -U seqeval
!pip install -U spacy-alignments==0.9.1
!pip install -U tensorflow~=2.16
!pip install -U tensorflow-text~=2.16
!pip install -U tf_keras~=2.16
!pip install -U transformers==4.38.2

Could you please share all the dependencies to replicate the issue.

Please find the zipfile from my 'Colab Notebooks' drive folder + data which I ran on Colab directly.
https://github.com/msusol/kaggle/blob/main/competition-20240410T165614Z-001.zip (28MB > 25MB allowed here)

Screenshot 2024-04-10 at 11 08 22 AM

Originally posted by @msusol in keras-team/tf-keras#771 (comment)