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

Client端输入类型为list时,需要展平成一维,不然无法通过shape检查 #672

Closed
barrierye opened this issue Jun 11, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@barrierye
Copy link
Contributor

barrierye commented Jun 11, 2020

#625 中,用户通过HTTP方式发送 image.reshape(1, 28, 28).tolist() 数据,但因为没有通过shape检查导致预测失败。

Client中shape检查的相关代码:

218     def shape_check(self, feed, key):
219         if key in self.lod_tensor_set:
220             return
221         if isinstance(feed[key],
222                       list) and len(feed[key]) != self.feed_tensor_len[key]:
223             raise ValueError("The shape of feed tensor {} not match.".format(
224                 key))
225         if type(feed[key]).__module__ == np.__name__ and np.size(feed[
226                 key]) != self.feed_tensor_len[key]:
227             #raise SystemExit("The shape of feed tensor {} not match.".format(
228             #    key))
229             pass
@barrierye barrierye changed the title Client Client端输入类型为list时,需要展平成一维,不然无法通过shape检查 Jun 11, 2020
@bjjwwang
Copy link
Collaborator

之后计划统一用numpy正在建设中

@TeslaZhao TeslaZhao added the enhancement New feature or request label Aug 31, 2020
@paddle-bot paddle-bot bot closed this as completed Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants