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

训练后没有效果,我换了data2里面的内容后,又报如下错误 。。 #38

Open
cywjava opened this issue Mar 30, 2023 · 10 comments

Comments

@cywjava
Copy link

cywjava commented Mar 30, 2023

/MyTrainer.py", line 819, in _get_train_sampler
return RandomSampler(self.train_dataset, generator=generator)
File "/home/thudm/.local/lib/python3.7/site-packages/torch/utils/data/sampler.py", line 108, in init
"value, but got num_samples={}".format(self.num_samples))
ValueError: num_samples should be a positive integer value, but got num_samples=0

@bh4ffu
Copy link

bh4ffu commented Mar 30, 2023

遇到了同样的问题,解决了么?大佬

@yuanzhoulvpi2017
Copy link
Owner

yuanzhoulvpi2017 commented Mar 30, 2023

注意使用我发布的最新版本的代码!!!!!!!!!
data2数据已经是老版本的数据了。03-28日最新代码

@alin995
Copy link

alin995 commented Mar 30, 2023

大概是用的旧的代码,之前也有人碰到过这个问题,是由于数据集被过滤后,变成空的了。用新的code02_训练模型全部流程.ipynb 不会碰到这个问题。

@bh4ffu
Copy link

bh4ffu commented Mar 30, 2023

我用新的 code02_训练模型全部流程.ipynb 可以跑通

@xiaoweiweixiao
Copy link

你们训练后有效果吗?我问模型属性相关的问题,还是之前chatglm模型的回答,没有纠正过来。

@cywjava
Copy link
Author

cywjava commented Mar 31, 2023

参考作者的data2数据集里,问:你是谁?,我是良XXXX程序员训练的一个AI模型。。

看它用了多少数据量。 讲一次两次。它听不进去。。思维太固执了,据作者说要1600次。我估计 得准备几十上百轮吧。

@yuanzhoulvpi2017
Copy link
Owner

yuanzhoulvpi2017 commented Mar 31, 2023 via email

@yuanzhoulvpi2017
Copy link
Owner

yuanzhoulvpi2017 commented Mar 31, 2023 via email

@luieswww
Copy link

luieswww commented Apr 2, 2023

是的 发自我的 iPhone 在 2023年3月31日,11:45,chenyiwan @.> 写道:  参考作者的data2数据集里,问:你是信,我是良XXXX程序员训练的一个AI模型。。 看它用了多少数据量。 讲一次两次。它听不进去。。思维太固执了,据作者说要1600次。我估计 得准备几十上百轮吧。 — Reply to this email directly, view it on GitHub<#38 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHJRI6PESFC3GNR55RDV3ETW6ZHLVANCNFSM6AAAAAAWMXAT24. You are receiving this because you commented.Message ID: @.>

这个1600次是啥意思,就是说要准备1600次问你是谁,然后回答是xxx,就可以转变过来了?

@luieswww
Copy link

luieswww commented Apr 2, 2023

我一行行的运行的,到最后就报错了RuntimeError: self and mat2 must have the same dtype。

运行下面的代码:

 20 trainer = MyTrainer(
 21     model=model,
 22     tokenizer=tokenizer,

(...)
26 eval_dataset=tokenized_datasets["valid"],
27 )
---> 28 trainer.train()的时候

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

6 participants