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

在train.py中第449行报错如下:这是程序的问题?还是配置环境的问题呢?能麻烦您给出准确的配置环境版本吗 #14

Open
star-rui opened this issue Oct 13, 2023 · 4 comments

Comments

@star-rui
Copy link

Traceback (most recent call last):
File "/root/LMKE-main/main.py", line 213, in
trainer.run()
File "/root/LMKE-main/trainer.py", line 96, in run
self.train()
File "/root/LMKE-main/trainer.py", line 396, in train
self.triple_classification(epc)
File "/root/LMKE-main/trainer.py", line 449, in triple_classification
preds = model(inputs, positions, mode, triple_degrees)
File "/opt/conda/envs/pytorch1.8/lib/python3.9/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
TypeError: forward() takes 4 positional arguments but 5 were given

@AustynDing
Copy link

Traceback (most recent call last): File "/root/LMKE-main/main.py", line 213, in trainer.run() File "/root/LMKE-main/trainer.py", line 96, in run self.train() File "/root/LMKE-main/trainer.py", line 396, in train self.triple_classification(epc) File "/root/LMKE-main/trainer.py", line 449, in triple_classification preds = model(inputs, positions, mode, triple_degrees) File "/opt/conda/envs/pytorch1.8/lib/python3.9/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) TypeError: forward() takes 4 positional arguments but 5 were given

改成:preds = model(inputs, positions, mode)好像可以正常运行

@star-rui
Copy link
Author

是的,谢谢,我把triple_degrees这个参数去掉后,确实可以正常训练了。

@twrjie
Copy link

twrjie commented Jun 29, 2024

image
我也遇到了类似的问题,请问这样应该怎么改

@Neph0s
Copy link
Owner

Neph0s commented Jun 29, 2024

image 我也遇到了类似的问题,请问这样应该怎么改

Sorry,这里有个之前重构代码遗留的bug,我已经修复了,你重新pull试试

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

4 participants