universal-ie / UIE

Unified Structure Generation for Universal Information Extraction
900 stars 99 forks source link

TypeError: _maybe_log_save_evaluate() takes 5 positional arguments but 6 were given #43

Open www-Ye opened 2 years ago

www-Ye commented 2 years ago

Error when running directly:

self._maybe_log_save_evaluate(tr_loss, model, trial, epoch, ignore_keys_for_eval)

TypeError: _maybe_log_save_evaluate() takes 5 positional arguments but 6 were given

Josiahhx commented 2 years ago

Did you solve it, I also encountered this problem

www-Ye commented 2 years ago

Did you solve it, I also encountered this problem

You can try modifying line 108 of the file constrained_seq2seq.py under /uie/seq2seq Set def _maybe_log_save_evaluate(self, tr_loss, model, trial, epoch): change to def _maybe_log_save_evaluate(self, tr_loss, model, trial, epoch, ignore_keys_for_eval): Might solve the problem

Josiahhx commented 2 years ago

Did you solve it, I also encountered this problem

You can try modifying line 108 of the file constrained_seq2seq.py under /uie/seq2seq Set def _maybe_log_save_evaluate(self, tr_loss, model, trial, epoch): change to def _maybe_log_save_evaluate(self, tr_loss, model, trial, epoch, ignore_keys_for_eval): Might solve the problem

Thanks, it has been solved

Josiahhx commented 2 years ago

image AttributeError: 'ConstraintSeq2SeqTrainer' object has no attribute '_max_length'

I've finished training the first epoch, but this is the next error

Did you encounter this problem later, and if so, how to solve it?

www-Ye commented 2 years ago

image AttributeError: 'ConstraintSeq2SeqTrainer' object has no attribute '_max_length'

I've finished training the first epoch, but this is the next error

Did you encounter this problem later, and if so, how to solve it?

I'm sorry I haven't encountered this problem later

www-Ye commented 2 years ago

You can try modifying line 108 of the file constrained_seq2seq.py under /uie/seq2seq Set    def _maybe_log_save_evaluate(self, tr_loss, model, trial, epoch): change to     def _maybe_log_save_evaluate(self, tr_loss, model, trial, epoch, ignore_keys_for_eval): Might solve the problem

------------------ 原始邮件 ------------------ 发件人: "universal-ie/UIE" @.>; 发送时间: 2022年9月20日(星期二) 晚上6:25 @.>; @.**@.>; 主题: Re: [universal-ie/UIE] TypeError: _maybe_log_save_evaluate() takes 5 positional arguments but 6 were given (Issue #43)

Error when running directly: self._maybe_log_save_evaluate(tr_loss, model, trial, epoch, ignore_keys_for_eval)
TypeError: _maybe_log_save_evaluate() takes 5 positional arguments but 6 were given I had the same problem. Did you solve it?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Josiahhx commented 2 years ago

You can try modifying line 108 of the file constrained_seq2seq.py under /uie/seq2seq Set    def _maybe_log_save_evaluate(self, tr_loss, model, trial, epoch): change to     def _maybe_log_save_evaluate(self, tr_loss, model, trial, epoch, ignore_keys_for_eval): Might solve the problem ------------------ 原始邮件 ------------------ 发件人: "universal-ie/UIE" @.>; 发送时间: 2022年9月20日(星期二) 晚上6:25 @.>; @.**@.>; 主题: Re: [universal-ie/UIE] TypeError: _maybe_log_save_evaluate() takes 5 positional arguments but 6 were given (Issue #43) Error when running directly: self._maybe_log_save_evaluate(tr_loss, model, trial, epoch, ignore_keys_for_eval) TypeError: _maybe_log_save_evaluate() takes 5 positional arguments but 6 were given I had the same problem. Did you solve it? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Thanks, I have solved the problem

0411tony commented 2 years ago

image AttributeError: 'ConstraintSeq2SeqTrainer' object has no attribute '_max_length'

I've finished training the first epoch, but this is the next error

Did you encounter this problem later, and if so, how to solve it?

I also encounter this problem, hence, I want to ask you did you solve this problem? And How to solve this problem? Thank you @Josiahhx

Josiahhx commented 2 years ago

image AttributeError: 'ConstraintSeq2SeqTrainer' object has no attribute '_max_length' I've finished training the first epoch, but this is the next error Did you encounter this problem later, and if so, how to solve it?

I also encounter this problem, hence, I want to ask you did you solve this problem? And How to solve this problem? Thank you @Josiahhx

This place is like the following change, other places are similar

"max_length": self.model.config.max_length

0411tony commented 2 years ago

image AttributeError: 'ConstraintSeq2SeqTrainer' object has no attribute '_max_length' I've finished training the first epoch, but this is the next error Did you encounter this problem later, and if so, how to solve it?

I also encounter this problem, hence, I want to ask you did you solve this problem? And How to solve this problem? Thank you @Josiahhx

This place is like the following change, other places are similar

"max_length": self.model.config.max_length

Thanks for your reply. I have solved this problem.