Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

训练时,遇到错误' RuntimeError(f"Input {texts[i]} is too long for context length {context_length}")' #5

Open
Qusijia opened this issue May 25, 2023 · 8 comments

Comments

@Qusijia
Copy link

Qusijia commented May 25, 2023

感谢你的工作,在我训练flickr30k时,总是在中间中断,并报上述错误,想请问您是否有什么需要修改的或者一些别的建议能给到我。多有打扰,感谢!

@bubbliiiing
Copy link
Owner

额,太长了呀,估计要padding限制一下

@Qusijia
Copy link
Author

Qusijia commented May 29, 2023

不好意思,想具体请教一下,我是否可以将 tokenize(_tokenizer, texts: Union[str, List[str]], context_length: int = 77, truncate: bool = False) -> Union[torch.IntTensor, torch.LongTensor]:
中的 truncate设置为True来解决?

@bubbliiiing
Copy link
Owner

啊对对,我写错了……是阶段

@bubbliiiing
Copy link
Owner

截断

@Qusijia
Copy link
Author

Qusijia commented Jun 1, 2023

感谢你的回答,通过你的回答,我解决了这个问题,非常感谢!

@Qusijia
Copy link
Author

Qusijia commented Jun 1, 2023

我在训练的时候,出现了一个现象,就是越训练效果越差反而最好的参数是在epoch1,不知道您有没有出现这种情况?我训练时调整了batchsize会不会跟这个有关系?不知道您有没有什么建议?我猜测是过拟合了,现调小了学习率,但看目前训练的效果,感觉并没有解决。

@bubbliiiing
Copy link
Owner

额,是过拟合不好解决的

1 similar comment
@bubbliiiing
Copy link
Owner

额,是过拟合不好解决的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants