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

AttributeError: 'SeqUnit' object has no attribute 'mean_loss' #20

Open
zhangzhang827 opened this issue Oct 20, 2022 · 0 comments
Open

Comments

@zhangzhang827
Copy link

Traceback (most recent call last):
File "D:/pycharmprojects/wiki2bio-master/Main.py", line 241, in
main()
File "D:/pycharmprojects/wiki2bio-master/Main.py", line 234, in main
train(sess, dataloader, model)
File "D:/pycharmprojects/wiki2bio-master/Main.py", line 99, in train
loss += model(x, sess)
File "D:\pycharmprojects\wiki2bio-master\SeqUnit_1.py", line 411, in call
loss, _ = sess.run([self.mean_loss, self.train_op],
AttributeError: 'SeqUnit' object has no attribute 'mean_loss'

def call(self, x, sess):
loss, _ = sess.run([self.mean_loss, self.train_op],
{self.encoder_input: x['enc_in'], self.encoder_len: x['enc_len'],
self.encoder_field: x['enc_fd'], self.encoder_pos: x['enc_pos'],
self.encoder_rpos: x['enc_rpos'], self.decoder_input: x['dec_in'],
self.decoder_len: x['dec_len'], self.decoder_output: x['dec_out']})
return loss
Hello, I have been debugging this error for a long time, but it has always been wrong. I would like to ask if you can help me, thank you。

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

1 participant