Hi,
I get the following error when trying to build object detection (cross-compiling on linux)
ERROR: /mediapipe/mediapipe/examples/coral/BUILD:23:1: error loading package 'mediapipe/framework/formats': in /mediapipe/mediapipe/framework/port/build_config.bzl: in /root/.cache/bazel/_bazel_root/4884d566396e9b67b6
2185751879ad14/external/com_google_protobuf/protobuf.bzl: Unable to find package for @rules_python//python:defs.bzl: The repository '@rules_python' could not be resolved. and referenced by '//mediapipe/examples/coral:
demo_run_graph_main'
ERROR: /mediapipe/mediapipe/examples/coral/BUILD:23:1: error loading package 'mediapipe/framework/formats': in /mediapipe/mediapipe/framework/port/build_config.bzl: in /root/.cache/bazel/_bazel_root/4884d566396e9b67b6
2185751879ad14/external/com_google_protobuf/protobuf.bzl: Unable to find package for @rules_python//python:defs.bzl: The repository '@rules_python' could not be resolved. and referenced by '//mediapipe/examples/coral:
demo_run_graph_main'
ERROR: Analysis of target '//mediapipe/examples/coral:object_detection_tpu' failed; build aborted: error loading package 'mediapipe/framework/formats': in /mediapipe/mediapipe/framework/port/build_config.bzl: in /root
/.cache/bazel/_bazel_root/4884d566396e9b67b62185751879ad14/external/com_google_protobuf/protobuf.bzl: Unable to find package for @rules_python//python:defs.bzl: The repository '@rules_python' could not be resolved.
I am getting the same issue
Can you please make sure you have the latest release (or master) of MediaPipe?
Please double check you have followed the coral readme closely, and have configured the docker to have python , python-pip , python3-pip , python-numpy packages installed (should have been done automatically).
Does building the hello_world example work (as per coral readme)?
Also try running bazel clean --expunge before building again (note, if you run expunge, you will need to follow some of the coral readme setup again).
Yes, it is the latest from master (last commit on May 21st). I have followed the readme and the python packages are in the container. hello_world works. After cleaning, I still get the same error message (I did not redo any of the setup instructions).
Tried with the latest update on master, but still the same error when building.
Observed the same behaviors with the latest master code after following the steps.
I was experiencing the same issue as this but I have been able to resolve it. There is a repository missing from the /mediapipe/WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.0.2/rules_python-0.0.2.tar.gz",
strip_prefix = "rules_python-0.0.2",
sha256 = "b5668cde8bb6e3515057ef465a35ad712214962f0b3a314e551204266c7be90c",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
load("@rules_python//python:pip.bzl", "pip_repositories")
pip_repositories()
After adding that section the build also failed on a zlib repository, that can be fixed with:
http_archive(
name = "zlib",
build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
strip_prefix = "zlib-1.2.11",
urls = [
"https://mirror.bazel.build/zlib.net/zlib-1.2.11.tar.gz",
"https://zlib.net/zlib-1.2.11.tar.gz",
],
)
After adding both those sections I was able to build without error.
I've attached the code as markdown appears to be breaking the formatting.
Build Fix.txt
http_archive( name = "zlib", build_file = "@com_google_protobuf//:third_party/zlib.BUILD", sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1", strip_prefix = "zlib-1.2.11", urls = [ "https://mirror.bazel.build/zlib.net/zlib-1.2.11.tar.gz", "https://zlib.net/zlib-1.2.11.tar.gz", ], )
I added the above comment and still reported "The repository'@zlib' could not be resolved"
http_archive( name = "zlib", build_file = "@com_google_protobuf//:third_party/zlib.BUILD", sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1", strip_prefix = "zlib-1.2.11", urls = [ "https://mirror.bazel.build/zlib.net/zlib-1.2.11.tar.gz", "https://zlib.net/zlib-1.2.11.tar.gz", ], )
I added the above comment and still reported "The repository'@zlib' could not be resolved"
I add the code, and it works. you should place the code before com_google_protobuf
Most helpful comment
I add the code, and it works. you should place the code before com_google_protobuf