Giter Site home page Giter Site logo

Comments (8)

sqs17 avatar sqs17 commented on May 30, 2024

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.

sqs17 avatar sqs17 commented on May 30, 2024

image
I downloaded the model locally, using microsoft\deberta-v3-base

from pyabsa.

sqs17 avatar sqs17 commented on May 30, 2024

Its my checkpoints.
image

from pyabsa.

sqs17 avatar sqs17 commented on May 30, 2024

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
image

from pyabsa.

yangheng95 avatar yangheng95 commented on May 30, 2024

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.

sqs17 avatar sqs17 commented on May 30, 2024

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.

sqs17 avatar sqs17 commented on May 30, 2024

image
是指这里的output_dim吗

from pyabsa.

sqs17 avatar sqs17 commented on May 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.