tflite-micro icon indicating copy to clipboard operation
tflite-micro copied to clipboard

Conflict with bazel scripts and installed tflite_micro wheel

Open mansnils opened this issue 9 months ago • 1 comments

This comment summarize the problem: https://github.com/tensorflow/tflite-micro/pull/2545#issuecomment-2082843877

How to reproduce:

Make sure tflite_micro is not installed. Either of these should run successfully, ./tensorflow/lite/micro/tools/ci_build/test_generate_integration_tests.sh ./tensorflow/lite/micro/tools/ci_build/test_generate_micro_mutable_op_resolver_tests.sh

Now pip install tflite_micro and try to run the ci test scripts. It fails, e.g.

    from tflite_micro.tensorflow.lite.micro.tools import generate_test_for_model
ModuleNotFoundError: No module named 'tflite_micro.tensorflow.lite.micro'

mansnils avatar May 08 '24 16:05 mansnils

Summarizing the problem, taking generate_micro_mutable_op_resolver_from_model.py as example.

When running the script as regular python script without bazel, it does not work because visualize is not part of the tflite-micro wheel. When running the script with bazel, bazel can pick up visualize from the path tflite_micro/tensorflow/lite/tools as long as tflite-micro wheel is not installed. If tflite-micro is installed bazel will only look in that, where again visualize is not part of.

So problem is the script does not work when tflite-micro is installed.

Possible solutions:

  • Import visualize from tensorflow instead of tflite-micro. That should make it work for both bazel and as a regular python script.
  • Add visualize to tflite-micro. That should make it work for both bazel and as a regular python script.
  • Make bazel find visualize even if tflite-micro is installed. That will make it work for bazel, which is good enough as far as I am concerned.

mansnils avatar May 15 '24 07:05 mansnils

"This issue is being marked as stale due to inactivity. Remove label or comment to prevent closure in 5 days."

github-actions[bot] avatar Jun 11 '24 10:06 github-actions[bot]

"This issue is being closed because it has been marked as stale for 5 days with no further activity."

github-actions[bot] avatar Jun 16 '24 10:06 github-actions[bot]