ErnieModelForSequenceClassification 存储为动态图模型,加载做预测报错
Created by: xttian
raceback (most recent call last): File "re_predict.py", line 123, in _, pred_relation_types = re_model(FD.to_variable(val_tokens_group), FD.to_variable(val_segments_group)) File "/home/xuetao/anaconda3/envs/paddle/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py", line 461, in call outputs = self.forward(*inputs, **kwargs) File "/home/xuetao/anaconda3/envs/paddle/lib/python3.7/site-packages/ernie/modeling_ernie.py", line 386, in forward logits = self.classifier(hidden) File "/home/xuetao/anaconda3/envs/paddle/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py", line 461, in call outputs = self.forward(*inputs, **kwargs) File "/home/xuetao/anaconda3/envs/paddle/lib/python3.7/site-packages/paddle/fluid/dygraph/nn.py", line 941, in forward pre_bias = _varbase_creator(dtype=input.dtype) AttributeError: 'NoneType' object has no attribute 'dtype'