Closed jorie-peng closed 3 years ago
ok, I find the reason. because paramter ceil_mode in nn.AvgPool2d, when set it as True, the pb model would have pyfunc
i use onnx=1.7.0, onnx-tf=1.7.0(branch tf1.x), tensorflow=1.15.0. but it also require me to install tensorflow-addons....... what's the problem?
i want to conver pth ->onnx -> pb -> savedmodel... how can i do?
The branch tf1.x is no longer actively maintained. It will work as-is, producing a pb, not a SavedModel. Upgrade to TF 2 is the easiest path to getting an ONNX model to a TF SavedModel.
hi, did you get the variables file in the saved model dir
when convert pytorch -> onnx -> tensorflow(.pb) -> tensorflow(Savemodel), there is issue in tensorflow_serving, I can load Saved model as normal, but when using tensorflow serving, it will fail, here is wrong information. onnx=1.7.0, onnx-tf=1.7.0(branch tf1.x), tensorflow=1.15.0
as I know, py_func can only be used in python, but tensorflow serving use c++, so it will have error, so the only solution is to remove py_func in tensorflow model. according to similar issue: #167 the solution in to change strict to false, but for my model, I can only convert success with strict=True
when I check my .pb model, it really has pyfunc op, how can I convert my pytorch model without pyfunc? Thanks! here is my convert model code:
my model is resnest model,so will have maxpooling. ps: when convert onnx to .pb, I use strict=True according to official tutorial, and if change to strict=False, it will fail.
here is pytorch model file: https://s3.us-west-1.wasabisys.com/resnest/torch/resnest50-528c19ca.pth