transformer模型save_inference_model之后进行预测报错
Created by: gromzhu
将训练好的transformer模型save_inference_model之后,加载保存的inference_model预测,报错shape不同,我用paddle保存模型的时候tensor shape设置的是(none,1),然后预测的时候我传shape(-1,1)的变量进去报错shape不相等。
报错信息 File ".jumbo/lib/python2.7/site-packages/paddle/fluid/executor.py", line 225, in check_feed_shape_type (var.name, len(var.shape), var.shape, diff_shape)) ValueError: The fed Variable u'init_score' should have dimensions = 1, shape = (0L,), but received fed shape [-1L, 1L] on each device