tensorflow / tflite-micro

Infrastructure to enable deployment of ML models to low-power resource-constrained embedded targets (including microcontrollers and digital signal processors).
Apache License 2.0
1.85k stars 805 forks source link

Conflict with bazel scripts and installed tflite_micro wheel #2564

Closed mansnils closed 3 months ago

mansnils commented 4 months ago

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 commented 4 months ago

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:

github-actions[bot] commented 3 months ago

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

github-actions[bot] commented 3 months ago

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