Finally, I’m using tf_core and solved my problem, as follows:
import tensorflow_core as tf_core
tf.compat.v1.enable_eager_execution()
tf_core.python.saved_model.load('model/trt_int8', tags=[trt.tag_constants.SERVING])
- Jetpack 4.4 DP
- tensorflow-2.1.0+nv20.4-cp36-cp36m-linux_aarch64
When I was trying loading my tensor rt model, some error occur:
tf.saved_model.load('model/trt_int8', tags=[trt.tag_constants.SERVING])
>>>TypeError: load() missing 1 required positional argument: 'export_dir'
Then, I found load() func require “sess”:
tf.saved_model.load()
>>>TypeError: load() missing 3 required positional arguments: 'sess', 'tags', and 'export_dir'
Enable eager execution, nothing better:
tf.compat.v1.enable_eager_execution()
tf.saved_model.load()
>>>TypeError: load() missing 3 required positional arguments: 'sess', 'tags', and 'export_dir'
Finally, I’m trying use tensorflow_core api.
import tensorflow_core as tf_core
tf_core._api.v2.saved_model.load('model/trt_int8', tags=[trt.tag_constants.SERVING])
>>> AttributeError: module 'tensorflow_core._api' has no attribute 'v2'
How to solve this issue,
Thanks.