Traceback (most recent call last):
File "/16uw/test/MODULE_FMC/scriptTraitements/classifying.py", line 408, in <module>
pred = predict(emb, test_model)
File "/16uw/test/MODULE_FMC/scriptTraitements/classifying.py", line 279, in predict
raw_pred, _, _ = model.predict(emb_feature)
File "/l16uw/.conda/envs/bert/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1130, in __getattr__
raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'FlaubertForSequenceClassification' object has no attribute 'predict'
Yes.Thank you, Actually I finetuned a model via training with the trainer and evaluate on a test data. Now I wanted to load my model and use it on realdata world and as I said the model output the same class for my realdata. I was wondering if I wrote the code correctly. The preprocessing/training/evaluating/testing and saving best model work but when I tried to load the model for inference on new data. The model output same class for every sentence in my dataset even when I tried with the test_dataset I used to evaluate on. Could you help me, the model is supposed to be used by an app for professionnal usage.
As you see the output keep changing and is not fixed , I do not know How to solve it. Any idea could be helpful. Should I still use trainer for inference ?