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

youtubednn部署报错 #82

Open
kinghuin opened this issue Jul 5, 2022 · 0 comments
Open

youtubednn部署报错 #82

kinghuin opened this issue Jul 5, 2022 · 0 comments

Comments

@kinghuin
Copy link

kinghuin commented Jul 5, 2022

Describe the bug(问题描述)
hi,这是一个很棒的项目,我在
youtubednn user tower
部署完成后,报错

(Pdb) stub.Predict(request)
*** grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
        status = StatusCode.INVALID_ARGUMENT
        details = "ConcatOp : Expected concatenating dimensions in the range [-2, 2), but got 2
         [[{{node model_1/concatenate/concat}}]]"
        debug_error_string = "{"created":"@165693","description":"Error received from peer ipv4:*******:80**","file":"src/core/lib/surface/call.cc","file_line":952,"grpc_message":"ConcatOp : Expected concatenating dimensions in the range [-2, 2), but got 2\n\t [[{{node model_1/concatenate/concat}}]]","grpc_status":3}"

期待项目能够完善一下模型部署部分

To Reproduce(复现步骤)
Steps to reproduce the behavior:

  1. 参考运行example文件夹下的代码,想把模型保存为save model格式,同样方式dssm模型成功保存,youtubematch、sdm、mind却保存报错 #46 (comment) 修复deepctr的模型导出bug
  2. 参考https://github.com/shenweichen/DeepMatch/blob/v0.2.1/examples/run_youtubednn.py#L81 划出用户塔
  3. 如果使用tf.keras.models.save_model(user_embedding_model,"./export_model/youtubeuser/1") 则在导出阶段就报错
TypeError: Could not build a TypeSpec for <KerasTensor: shape=(None, 15) dtype=float32 (created by layer 'tf.compat.v1.squeeze')> with type KerasTensor

如果使用tf.saved_model.save(obj=user_embedding_model, export_dir='./export_model/youtube_dnn_user_tower/1',signatures=None) 则顺利导出,但在部署好以后,报错

(Pdb) stub.Predict(request)
*** grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
        status = StatusCode.INVALID_ARGUMENT
        details = "ConcatOp : Expected concatenating dimensions in the range [-2, 2), but got 2
         [[{{node model_1/concatenate/concat}}]]"
        debug_error_string = "{"created":"@165693","description":"Error received from peer ipv4:*******:80**","file":"src/core/lib/surface/call.cc","file_line":952,"grpc_message":"ConcatOp : Expected concatenating dimensions in the range [-2, 2), but got 2\n\t [[{{node model_1/concatenate/concat}}]]","grpc_status":3}"

怀疑是建模时使用了一些不适合部署的操作

Operating environment(运行环境):

  • python 3.7
  • tensorflow 1.15.5
  • deepmatch 0.2.0

Additional context
Add any other context about the problem here.

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