--------------------------------------------------------------------------- InvalidArgumentError Traceback (most recent call last) in 3 print() 4 print(df['review'][5171]) ----> 5 nlp(new_texts[5170][-1990:]) /anaconda/envs/azureml_py38_tensorflow/lib/python3.8/site-packages/transformers/pipelines/text_classification.py in __call__(self, *args, **kwargs) 124 If ``self.return_all_scores=True``, one such dictionary is returned per label. 125 """ --> 126 return super().__call__(*args, **kwargs) 127 128 def preprocess(self, inputs, **tokenizer_kwargs) -> Dict[str, GenericTensor]: /anaconda/envs/azureml_py38_tensorflow/lib/python3.8/site-packages/transformers/pipelines/base.py in __call__(self, inputs, num_workers, *args, **kwargs) 922 return self.get_iterator(inputs, num_workers, preprocess_params, forward_params, postprocess_params) 923 else: --> 924 return self.run_single(inputs, preprocess_params, forward_params, postprocess_params) 925 926 def run_multi(self, inputs, preprocess_params, forward_params, postprocess_params): /anaconda/envs/azureml_py38_tensorflow/lib/python3.8/site-packages/transformers/pipelines/text_classification.py in run_single(self, inputs, preprocess_params, forward_params, postprocess_params) 170 def run_single(self, inputs, preprocess_params, forward_params, postprocess_params): 171 "This pipeline is odd, and return a list when single item is run" --> 172 return [super().run_single(inputs, preprocess_params, forward_params, postprocess_params)] /anaconda/envs/azureml_py38_tensorflow/lib/python3.8/site-packages/transformers/pipelines/base.py in run_single(self, inputs, preprocess_params, forward_params, postprocess_params) 929 def run_single(self, inputs, preprocess_params, forward_params, postprocess_params): 930 model_inputs = self.preprocess(inputs, **preprocess_params) --> 931 model_outputs = self.forward(model_inputs, **forward_params) 932 outputs = self.postprocess(model_outputs, **postprocess_params) 933 return outputs /anaconda/envs/azureml_py38_tensorflow/lib/python3.8/site-packages/transformers/pipelines/base.py in forward(self, model_inputs, **forward_params) 873 if self.framework == "tf": 874 model_inputs["training"] = False --> 875 model_outputs = self._forward(model_inputs, **forward_params) 876 elif self.framework == "pt": 877 inference_context = self.get_inference_context() /anaconda/envs/azureml_py38_tensorflow/lib/python3.8/site-packages/transformers/pipelines/text_classification.py in _forward(self, model_inputs) 131 132 def _forward(self, model_inputs): --> 133 return self.model(**model_inputs) 134 135 def postprocess(self, model_outputs, function_to_apply=None, return_all_scores=False): /anaconda/envs/azureml_py38_tensorflow/lib/python3.8/site-packages/keras/engine/base_layer.py in __call__(self, *args, **kwargs) 1035 with autocast_variable.enable_auto_cast_variables( 1036 self._compute_dtype_object): -> 1037 outputs = call_fn(inputs, *args, **kwargs) 1038 1039 if self._activity_regularizer: /anaconda/envs/azureml_py38_tensorflow/lib/python3.8/site-packages/transformers/models/roberta/modeling_tf_roberta.py in call(self, input_ids, attention_mask, token_type_ids, position_ids, head_mask, inputs_embeds, output_attentions, output_hidden_states, return_dict, labels, training, **kwargs) 1435 kwargs_call=kwargs, 1436 ) -> 1437 outputs = self.roberta( 1438 inputs["input_ids"], 1439 attention_mask=inputs["attention_mask"], /anaconda/envs/azureml_py38_tensorflow/lib/python3.8/site-packages/keras/engine/base_layer.py in __call__(self, *args, **kwargs) 1035 with autocast_variable.enable_auto_cast_variables( 1036 self._compute_dtype_object): -> 1037 outputs = call_fn(inputs, *args, **kwargs) 1038 1039 if self._activity_regularizer: /anaconda/envs/azureml_py38_tensorflow/lib/python3.8/site-packages/transformers/models/roberta/modeling_tf_roberta.py in call(self, input_ids, attention_mask, token_type_ids, position_ids, head_mask, inputs_embeds, encoder_hidden_states, encoder_attention_mask, past_key_values, use_cache, output_attentions, output_hidden_states, return_dict, training, **kwargs) 674 inputs["token_type_ids"] = tf.fill(dims=input_shape, value=0) 675 --> 676 embedding_output = self.embeddings( 677 input_ids=inputs["input_ids"], 678 position_ids=inputs["position_ids"], /anaconda/envs/azureml_py38_tensorflow/lib/python3.8/site-packages/keras/engine/base_layer.py in __call__(self, *args, **kwargs) 1035 with autocast_variable.enable_auto_cast_variables( 1036 self._compute_dtype_object): -> 1037 outputs = call_fn(inputs, *args, **kwargs) 1038 1039 if self._activity_regularizer: /anaconda/envs/azureml_py38_tensorflow/lib/python3.8/site-packages/transformers/models/roberta/modeling_tf_roberta.py in call(self, input_ids, position_ids, token_type_ids, inputs_embeds, past_key_values_length, training) 167 position_ids = tf.tile(input=position_ids, multiples=(input_shape[0], 1)) 168 --> 169 position_embeds = tf.gather(params=self.position_embeddings, indices=position_ids) 170 token_type_embeds = tf.gather(params=self.token_type_embeddings, indices=token_type_ids) 171 final_embeddings = self.embeddings_sum(inputs=[inputs_embeds, position_embeds, token_type_embeds]) /anaconda/envs/azureml_py38_tensorflow/lib/python3.8/site-packages/tensorflow/python/util/dispatch.py in wrapper(*args, **kwargs) 204 """Call target, and fall back on dispatchers if there is a TypeError.""" 205 try: --> 206 return target(*args, **kwargs) 207 except (TypeError, ValueError): 208 # Note: convert_to_eager_tensor currently raises a ValueError, not a /anaconda/envs/azureml_py38_tensorflow/lib/python3.8/site-packages/tensorflow/python/ops/array_ops.py in gather_v2(params, indices, validate_indices, axis, batch_dims, name) 5067 batch_dims=0, 5068 name=None): -> 5069 return gather( 5070 params, 5071 indices, /anaconda/envs/azureml_py38_tensorflow/lib/python3.8/site-packages/tensorflow/python/util/deprecation.py in new_func(*args, **kwargs) 547 'in a future version' if date is None else ('after %s' % date), 548 instructions) --> 549 return func(*args, **kwargs) 550 551 doc = _add_deprecated_arg_notice_to_docstring( /anaconda/envs/azureml_py38_tensorflow/lib/python3.8/site-packages/tensorflow/python/util/dispatch.py in wrapper(*args, **kwargs) 204 """Call target, and fall back on dispatchers if there is a TypeError.""" 205 try: --> 206 return target(*args, **kwargs) 207 except (TypeError, ValueError): 208 # Note: convert_to_eager_tensor currently raises a ValueError, not a /anaconda/envs/azureml_py38_tensorflow/lib/python3.8/site-packages/tensorflow/python/ops/array_ops.py in gather(***failed resolving arguments***) 5054 # TODO(apassos) find a less bad way of detecting resource variables 5055 # without introducing a circular dependency. -> 5056 return params.sparse_read(indices, name=name) 5057 except AttributeError: 5058 return gen_array_ops.gather_v2(params, indices, axis, name=name) /anaconda/envs/azureml_py38_tensorflow/lib/python3.8/site-packages/tensorflow/python/ops/resource_variable_ops.py in sparse_read(self, indices, name) 711 with ops.name_scope("Gather" if name is None else name) as name: 712 variable_accessed(self) --> 713 value = gen_resource_variable_ops.resource_gather( 714 self.handle, indices, dtype=self._dtype, name=name) 715 /anaconda/envs/azureml_py38_tensorflow/lib/python3.8/site-packages/tensorflow/python/ops/gen_resource_variable_ops.py in resource_gather(resource, indices, dtype, batch_dims, validate_indices, name) 547 return _result 548 except _core._NotOkStatusException as e: --> 549 _ops.raise_from_not_ok_status(e, name) 550 except _core._FallbackException: 551 pass /anaconda/envs/azureml_py38_tensorflow/lib/python3.8/site-packages/tensorflow/python/framework/ops.py in raise_from_not_ok_status(e, name) 6939 message = e.message + (" name: " + name if name is not None else "") 6940 # pylint: disable=protected-access -> 6941 six.raise_from(core._status_to_exception(e.code, message), None) 6942 # pylint: enable=protected-access 6943 /anaconda/envs/azureml_py38_tensorflow/lib/python3.8/site-packages/six.py in raise_from(value, from_value) InvalidArgumentError: indices[0,512] = 514 is not in [0, 514) [Op:ResourceGather]