google-coral / pycoral

Python API for ML inferencing and transfer-learning on Coral devices
https://coral.ai
Apache License 2.0
347 stars 144 forks source link

tflite runtime conflicts with tensorflow version #60

Closed corvitacvision closed 2 years ago

corvitacvision commented 2 years ago

Description

Hello all, I am using USB Coral TPU. I want to update my code from libedgetpu to Pycoral. I am using tensorflow 2.6, pycoral version: 2.0 and tflite_runtime : 2.5.0.post. I have successfully installed the packages but when I run my object detection code and I also want to use tensorflow in parallel at that time I am getting following runtime error. Any help is appreciated!

import tensorflow as tf
from ._api.v2 import compat
from . import v1
from tensorflow._api.v2.compat.v1 import lite
from . import experimental
from tensorflow.lite.python.lite import OpResolverType
from tensorflow.lite.python.interpreter import Interpreter  # pylint: disable=unused-import
from tensorflow.lite.python.interpreter_wrapper import _pywrap_tensorflow_interpreter_wrapper as _interpreter_wrapper
ImportError: generic_type: type "InterpreterWrapper" is already registered!
Click to expand! ### Issue Type Build/Install ### Operating System Ubuntu ### Coral Device USB Accelerator ### Other Devices _No response_ ### Programming Language Python 3.6 ### Relevant Log Output _No response_
hjonnala commented 2 years ago

@corvitacvision can you please check this https://github.com/google-coral/pycoral/issues/57#issuecomment-949997068 issue to fix it.

corvitacvision commented 2 years ago

@hjonnala Thank you for your reply. I have solved the issue by downgrading tensorflow version from 2.6 to 2.4 and now it runs without any runtime error.

google-coral-bot[bot] commented 2 years ago

Are you satisfied with the resolution of your issue? Yes No