Open ChaojifeixiaDazhuang opened 1 year ago
Hi @ChaojifeixiaDazhuang I also encounter this problem recently, do you have any solution right now?
seems to be related to PyTorch models: https://github.com/pytorch/pytorch/issues/48389 maybe something hacky happens when pytorch models are converted to tensorflow models, at least that's my case.
Nevermind, I just installed latest tensorflow (pip3 install --upgrade tensorflow) which didnt fix anything, but then installed new tflite and it randomly fixed itself (pip install --upgrade tflite)
When I load a TFlite model with
relay.frontend.from_tflite
API, I get an AttributeError, as show below:Actual behavior
Traceback (most recent call last): File "tflite_main.py", line 59, in <module> mod, params = relay.frontend.from_tflite(tflite_model) File "/workspace/tvm/python/tvm/relay/frontend/tflite.py", line 4205, in from_tflite op_converter.convert_op_to_relay() File "/workspace/tvm/python/tvm/relay/frontend/tflite.py", line 276, in convert_op_to_relay ret = self.convert_map[op_code_str](op) File "/workspace/tvm/python/tvm/relay/frontend/tflite.py", line 748, in convert_resize_bilinear return self._convert_resize("linear", op) File "/workspace/tvm/python/tvm/relay/frontend/tflite.py", line 726, in _convert_resize half_pixel_centers = resize_options.HalfPixelCenters() AttributeError: 'ResizeBilinearOptions' object has no attribute 'HalfPixelCenters
Environment
Root Cause and Solution
try: half_pixel_centers = resize_options.HalfPixelCenters() except AttributeError: half_pixel_centers = False
As for ResizeBilinear Op, this attribution default to be false:https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/resize-bilinear/attrs#:~:text=TF_MUST_USE_RESULT%20Attrs-,Defaults%20to%20false.,-Public%20attributesGuys, do you have any suggestions?
Triage
cc @leandron