Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Dude, there's a bug in the code #274

Answered by ZeyuChen
daidaiJ asked this question in Q&A
Discussion options

when i run the 'erniecrffortokenclassification.py',There was a strange bug,
like this ;'TypeError: forward() missing 1 required positional argument: 'labels''
This error is happend in Fluid DyGraph's Layers.py
But I obviously passed in labels, otherwise the error would be in the line 65
64 if labels is not None:
---> 65 loss = self.crf_loss(logits, lengths, labels)
66 return loss
67 else:
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py in call(self, *inputs, **kwargs)
900 self._built = True
901
--> 902 outputs = self.forward(*inputs, **kwargs)
903
904 for forward_post_hook in self._forward_post_hooks.values():
TypeError: forward() missing 1 required positional argument: 'labels'

You must be logged in to vote

Could you provide your paddlenlp version and paddlepaddle version?
Please make sure you are using the latest version.

Replies: 1 comment 4 replies

Comment options

Could you provide your paddlenlp version and paddlepaddle version?
Please make sure you are using the latest version.

You must be logged in to vote
4 replies
Comment options

Comment options

Em, I checked that the version of the module is 2.0.0rc7, is it because the version does not match?

Comment options

Maybe @daidaiJ Please upgrade to the latest version rc18 and try again.

Comment options

thanks , ahhhh~

Answer selected by ZeyuChen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /