Closed nikhilbchilwant closed 3 years ago
Hi @nikhilbchilwant,
It appears to be some sort of incompatibility with a recent version of the HuggingFace transformers
library. Can you downgrade to transformers>=2.5.1,<=3.5
and try running again? Let me know if this resolves your issue.
I was able to run all the experiments with default configuration i.e. for
ModelType.NB
. I am trying to run the same code for BERT but I am getting below dimensional error.tensorflow.python.framework.errors_impl.InvalidArgumentError: 2 root error(s) found. (0) Invalid argument: assertion failed: [Condition x == y did not hold element-wise:] [x (sparse_categorical_crossentropy/SparseSoftmaxCrossEntropyWithLogits/Shape_1:0) = ] [50 1] [y (sparse_categorical_crossentropy/SparseSoftmaxCrossEntropyWithLogits/strided_slice:0) = ] [50 100] [[node sparse_categorical_crossentropy/SparseSoftmaxCrossEntropyWithLogits/assert_equal_1/Assert/Assert (defined at /nethome/nchilwant/projects/low-resource-text-classification-framework/lrtc_lib/train_and_infer_service/train_and_infer_hf.py:145) ]] [[gradient_tape/tf_bert_for_sequence_classification/bert/embeddings/position_embeddings/embedding_lookup/Reshape/_696]] (1) Invalid argument: assertion failed: [Condition x == y did not hold element-wise:] [x (sparse_categorical_crossentropy/SparseSoftmaxCrossEntropyWithLogits/Shape_1:0) = ] [50 1] [y (sparse_categorical_crossentropy/SparseSoftmaxCrossEntropyWithLogits/strided_slice:0) = ] [50 100] [[node sparse_categorical_crossentropy/SparseSoftmaxCrossEntropyWithLogits/assert_equal_1/Assert/Assert (defined at /nethome/nchilwant/projects/low-resource-text-classification-framework/lrtc_lib/train_and_infer_service/train_and_infer_hf.py:145) ]]
See detailed log in the attached file. How do I fix it? BERT_active_learning.log