You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the same problem with python 3.9 (worked well with 3.8).
Also - can anyone shed some light about the difference between the models absa/bert-rest-0.2 and absa/classifiers-rest-0.2 ? As in some of my attempts I noticed that the first managed to load and the second didn't.
In https://huggingface.co/absa it seems they were all updated at the same date.
import transformers
import aspect_based_sentiment_analysis as absa
name = 'absa/classifier-rest-0.2'
model = absa.BertABSClassifier.from_pretrained(name)
tokenizer = absa.BertTokenizer.from_pretrained(name)
ValueError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_40004/473772509.py in
5
6 name = 'absa/classifier-rest-0.2'
----> 7 model = absa.BertABSClassifier.from_pretrained(name)
8
9 tokenizer = BertTokenizer.from_pretrained(model)
~\Anaconda3\lib\site-packages\transformers\modeling_tf_utils.py in from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs)
1593 model(model.dummy_inputs) # build the network with dummy inputs
1594 else:
-> 1595 model(model.dummy_inputs) # build the network with dummy inputs
1596
1597 assert os.path.isfile(resolved_archive_file), f"Error retrieving file {resolved_archive_file}"
~\Anaconda3\lib\site-packages\keras\utils\traceback_utils.py in error_handler(*args, **kwargs)
65 except Exception as e: # pylint: disable=broad-except
66 filtered_tb = _process_traceback_frames(e.traceback)
---> 67 raise e.with_traceback(filtered_tb) from None
68 finally:
69 del filtered_tb
~\Anaconda3\lib\site-packages\aspect_based_sentiment_analysis\models.py in call(self, token_ids, attention_mask, token_type_ids, training, **bert_kwargs)
139 **bert_kwargs
140 ) -> Tuple[tf.Tensor, Tuple[tf.Tensor, ...], Tuple[tf.Tensor, ...]]:
--> 141 outputs = self.bert(
142 inputs=token_ids,
143 attention_mask=attention_mask,
ValueError: Exception encountered when calling layer "bert_abs_classifier_10" (type BertABSClassifier).
The first argument to
Layer.call
must always be passed.Call arguments received:
• token_ids={'input_ids': 'tf.Tensor(shape=(3, 5), dtype=int32)'}
• attention_mask=None
• token_type_ids=None
• training=False
• bert_kwargs=<class 'inspect._empty'>
The text was updated successfully, but these errors were encountered: