Comments (8)
and when i add "config.hidden_dim = 768"
error is :
Traceback (most recent call last):
File "c:\PyABSA-2\yelp\test.py", line 57, in
trainer = ATEPC.ATEPCTrainer(
File "D:\anaconda\envs\pyabsa2\lib\site-packages\pyabsa\tasks\AspectTermExtraction\trainer\atepc_trainer.py", line 69, in init
self._run()
File "D:\anaconda\envs\pyabsa2\lib\site-packages\pyabsa\framework\trainer_class\trainer_template.py", line 240, in _run
model_path.append(self.training_instructor(self.config).run())
File "D:\anaconda\envs\pyabsa2\lib\site-packages\pyabsa\tasks\AspectTermExtraction\instructor\atepc_instructor.py", line 799, in run
return self._train(criterion=None)
File "D:\anaconda\envs\pyabsa2\lib\site-packages\pyabsa\framework\instructor_class\instructor_template.py", line 353, in _train
self._resume_from_checkpoint()
File "D:\anaconda\envs\pyabsa2\lib\site-packages\pyabsa\framework\instructor_class\instructor_template.py", line 451, in _resume_from_checkpoint
self.model.load_state_dict(
File "D:\anaconda\envs\pyabsa2\lib\site-packages\torch\nn\modules\module.py", line 2153, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for FAST_LCF_ATEPC:
size mismatch for dense.weight: copying a param with shape torch.Size([3, 768]) from checkpoint, the shape in current model is torch.Size([2, 768]).
size mismatch for dense.bias: copying a param with shape torch.Size([3]) from checkpoint, the shape in current model is torch.Size([2]).
from pyabsa.
I downloaded the model locally, using microsoft\deberta-v3-base
from pyabsa.
from pyabsa.
This seems to have something to do with the training data set. I successfully fine-tuned the training data when I used 119.Yelp and 133.finNews, but I reported errors when I used my own data set and 99.PoliticalData. 99.PoliticalData has dimension 4, and my dataset has dimension 1
from pyabsa.
Please make sure that your datasets contains the same number of the labels as the pretrained model you are going to use. If the number of labels are not equal, please try fine-tuning the model based on merely your own dataset.
from pyabsa.
Hello, thank you very much for your answer.
The task I want to do now is to extract the aspect level of each sentence and conduct sentiment analysis. A sentence corresponds to multiple aspect levels. I don't quite understand the meaning of the number of labels, doesn't every sentence correspond to one aspect? If it corresponds to multiple aspects, repeat the sentence. Thanks again for your help.
from pyabsa.
from pyabsa.
Thanks for your suggestion, after modifying self.output_dim, my code runs well. Is this because the result of the pre-trained model is a triplet of this type? But my data is consistent with the data structure of the pre-trained model.
from pyabsa.
Related Issues (20)
- Fine-tuned ASTE model returns no triplets HOT 1
- The example code: Aspect_Term_Extraction.ipynb in the subfolder of aspect_term_extraction in examples-v2 is not working HOT 4
- PyABSA for German language? HOT 1
- No module named 'pyabsa.functional' HOT 4
- AspectExtractor returns aspects only if pred_sentiments=True in `extract_aspect` method but I don't want sentiments HOT 3
- how to train my own model? HOT 1
- Different performance between model saved as fine-tuned PLM and state_dict HOT 3
- Option for custom categories and custom rating
- Inference Speed HOT 1
- Import Error when using on Google Colab HOT 1
- Request for evaluation metrics HOT 3
- During training: warnings for ATE Classification Report HOT 2
- When training from saved checkpoint: `RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!` HOT 1
- How to rewrite the Custom Dataset? HOT 1
- How to Determine the Dataset Used for Pretrained Models from Checkpoints? HOT 5
- Seeking Guidance for Simple yet effective approch for ABSA for my FYP
- A faster generator.predict(comment)
- ASTE: list index out of range
- PyABSA Version 2 not working- RuntimeError: Exception: expected str, bytes or os.PathLike object, not NoneType Fail to load the model from multilingual!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyabsa.