InvalidArgument `labels` contains negative values
See original GitHub issueWhat can be the problem? Did anyone have something like this?
Saving checkpoints for 0 into results/model/model.ckpt.
Traceback (most recent call last): . . . .
InvalidArgumentError (see above for traceback): assertion failed: [`labels` contains negative values] [Condition x >= 0 did not hold element-wise:] [x (Reshape_5:0) = ] [8 12 -1...]
[[{{node confusion_matrix/assert_non_negative/assert_less_equal/Assert/AssertGuard/Assert}} = Assert[T=[DT_STRING, DT_STRING, DT_STRING, DT_INT64], summarize=3, _device="/job:localhost/replica:0/task:0/device:CPU:0"](confusion_matrix/assert_non_negative/assert_less_equal/Assert/AssertGuard/Assert/Switch, confusion_matrix/assert_non_negative/assert_less_equal/Assert/AssertGuard/Assert/data_0, confusion_matrix/assert_non_negative/assert_less_equal/Assert/AssertGuard/Assert/data_1, confusion_matrix/assert_non_negative/assert_less_equal/Assert/AssertGuard/Assert/data_2, confusion_matrix/assert_non_negative/assert_less_equal/Assert/AssertGuard/Assert/Switch_1)]]
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Tensorflow: Invalid argument: assertion failed: [`predictions ...
My labels were valid, no negative values and values in range(0, nclasses). The problem was that the learning_rate was too big. – Claudia...
Read more >tensorflow - 1] [Condition x <= y did not hold element-wise:]
Looking at the error message it seems you are using the same number of labels as you have classes, whereas the number of...
Read more >Metrics related [predictions must be <= 1] error
Hello,. I have the below error with TensorFlow 2.7. Same error happens with 2.6 but stack trace is different.
Read more >Error Responses - Amazon Simple Storage Service
Error Code Description HTTP Status Code
AccessControlListNotSupported The bucket does not allow ACLs. 400 Bad Request
AccessDenied Access Denied 403 Forbidden
BucketAlreadyOwnedByYou 409 Conflict (in all...
Read more >PowerPoint.Shape class - Office Add-ins | Microsoft Learn
Throws an InvalidArgument exception when set with a negative value. ... tags. Returns a collection of tags in the shape. textFrame.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @rashibudati , To share an update on this issue, I am using this solution to do something other than NER. I found that this issue comes because of line 45 of main.py. For padding tokens to match uneven length samples, @guillaumegenthial is using the label “O”. This means padded tokens are being tagged as “Others”. If your data does not have an “O” tag, then build_vocab.py script will not populate “O” in vocab.tags.txt. Hence during execution, it will find “O” tags that were used in padding as the foreign tags. This mismatch generates the error. The author’s answer about missing tags is correct. To fix this, you need to manually add a capital “O” tag in a new line of your vocab.tags.txt after running build_vocab.py
Solved my problem, thanks.