Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in building TensorFlow Object Detection Demo #70

Closed
hramireddy1 opened this issue Aug 30, 2019 · 4 comments
Closed

Error in building TensorFlow Object Detection Demo #70

hramireddy1 opened this issue Aug 30, 2019 · 4 comments
Assignees
Labels
platform:desktop desktop type:build/install For Build and Installation issues

Comments

@hramireddy1
Copy link

I was able to build and run the hello_world example on Desktop.

When i try to build the object detection demo using

$ bazel build -c opt
--define MEDIAPIPE_DISABLE_GPU=1
--define no_aws_support=true
mediapipe/examples/desktop/object_detection:object_detection_tensorflow

I receive the following errors:

WARNING: Download from https://mirror.bazel.build/github.com/tensorflow/tensorflow/archive/67def62936e28f97c16182dfcc467d8d1cae02b4.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found
WARNING: Download from http://mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/cf1e44edb908e9616030cc83d085989b8e6cd6df.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found
DEBUG: Rule 'build_bazel_rules_apple' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "6c9fcae7a3597aabd43f28be89466afe0eab18de", shallow_since = "1565379803 -0700" and dropping ["tag"]
DEBUG: Call stack for the definition of repository 'build_bazel_rules_apple' which is a git_repository (rule definition at /home/tcs/.cache/bazel/_bazel_tcs/3d4eb2cbf71caf8f570eba8043943dcc/external/bazel_tools/tools/build_defs/repo/git.bzl:195:18):

/home/tcs/mediapipe/WORKSPACE:251:1
INFO: Build option --define has changed, discarding analysis cache.
DEBUG: Rule 'rules_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "1991102fbff099a2e5eb990cdee3fdaf80803bf611c8fdf60f612e263438d0fb"
DEBUG: Call stack for the definition of repository 'rules_cc' which is a http_archive (rule definition at /home/tcs/.cache/bazel/_bazel_tcs/3d4eb2cbf71caf8f570eba8043943dcc/external/bazel_tools/tools/build_defs/repo/http.bzl:292:16):
/home/tcs/mediapipe/WORKSPACE:28:1
WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/protocolbuffers/protobuf/archive/310ba5ee72661c081129eb878c1bbcec936b20f0.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found
WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/libjpeg-turbo/libjpeg-turbo/archive/2.0.0.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found
WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/www.nasm.us/pub/nasm/releasebuilds/2.13.03/nasm-2.13.03.tar.bz2 failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found
WARNING: /home/tcs/.cache/bazel/_bazel_tcs/3d4eb2cbf71caf8f570eba8043943dcc/external/org_tensorflow/tensorflow/core/BUILD:560:12: in srcs attribute of cc_library rule @org_tensorflow//tensorflow/core:platform_strings: please do not import '@org_tensorflow//tensorflow/core/platform:platform_strings.cc' directly. You should either move the file to this package or depend on an appropriate rule there
WARNING: /home/tcs/.cache/bazel/_bazel_tcs/3d4eb2cbf71caf8f570eba8043943dcc/external/org_tensorflow/tensorflow/core/BUILD:560:12: in srcs attribute of cc_library rule @org_tensorflow//tensorflow/core:platform_strings: please do not import '@org_tensorflow//tensorflow/core/platform:platform_strings_computed.h' directly. You should either move the file to this package or depend on an appropriate rule there
INFO: Call stack for the definition of repository 'gif_archive' which is a tf_http_archive (rule definition at /home/tcs/.cache/bazel/_bazel_tcs/3d4eb2cbf71caf8f570eba8043943dcc/external/org_tensorflow/third_party/repo.bzl:124:19):
/home/tcs/.cache/bazel/_bazel_tcs/3d4eb2cbf71caf8f570eba8043943dcc/external/org_tensorflow/tensorflow/workspace.bzl:287:5
/home/tcs/.cache/bazel/_bazel_tcs/3d4eb2cbf71caf8f570eba8043943dcc/external/org_tensorflow/tensorflow/workspace.bzl:60:5
/home/tcs/mediapipe/WORKSPACE:121:1
WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/ufpr.dl.sourceforge.net/project/giflib/giflib-5.1.4.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found
WARNING: Download from http://pilotfiber.dl.sourceforge.net/project/giflib/giflib-5.1.4.tar.gz failed: class java.io.IOException GET returned 503 Service Unavailable
ERROR: An error occurred during the fetch of repository 'gif_archive':
java.io.IOException: Error downloading [https://storage.googleapis.com/mirror.tensorflow.org/ufpr.dl.sourceforge.net/project/giflib/giflib-5.1.4.tar.gz, http://pilotfiber.dl.sourceforge.net/project/giflib/giflib-5.1.4.tar.gz] to /home/tcs/.cache/bazel/_bazel_tcs/3d4eb2cbf71caf8f570eba8043943dcc/external/gif_archive/giflib-5.1.4.tar.gz: GET returned 503 Service Unavailable
INFO: Call stack for the definition of repository 'eigen_archive' which is a tf_http_archive (rule definition at /home/tcs/.cache/bazel/_bazel_tcs/3d4eb2cbf71caf8f570eba8043943dcc/external/org_tensorflow/third_party/repo.bzl:124:19):
/home/tcs/.cache/bazel/_bazel_tcs/3d4eb2cbf71caf8f570eba8043943dcc/external/org_tensorflow/tensorflow/workspace.bzl:170:5
/home/tcs/.cache/bazel/_bazel_tcs/3d4eb2cbf71caf8f570eba8043943dcc/external/org_tensorflow/tensorflow/workspace.bzl:60:5
/home/tcs/mediapipe/WORKSPACE:121:1
ERROR: /home/tcs/.cache/bazel/_bazel_tcs/3d4eb2cbf71caf8f570eba8043943dcc/external/org_tensorflow/tensorflow/core/platform/default/build_config/BUILD:212:1: @org_tensorflow//tensorflow/core/platform/default/build_config:gif depends on @gif_archive//:gif in repository @gif_archive which failed to fetch. no such package '@gif_archive//': java.io.IOException: Error downloading [https://storage.googleapis.com/mirror.tensorflow.org/ufpr.dl.sourceforge.net/project/giflib/giflib-5.1.4.tar.gz, http://pilotfiber.dl.sourceforge.net/project/giflib/giflib-5.1.4.tar.gz] to /home/tcs/.cache/bazel/_bazel_tcs/3d4eb2cbf71caf8f570eba8043943dcc/external/gif_archive/giflib-5.1.4.tar.gz: GET returned 503 Service Unavailable
ERROR: Analysis of target '//mediapipe/examples/desktop/object_detection:object_detection_tensorflow' failed; build aborted: Analysis failed
INFO: Elapsed time: 16.115s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 6304 targets c
onfigured)

@mgyong mgyong added type:build/install For Build and Installation issues platform:desktop desktop labels Aug 30, 2019
@mgyong mgyong self-assigned this Aug 30, 2019
@mgyong
Copy link

mgyong commented Aug 30, 2019

The errors look like download issues with your network connection. Are you blocked by firewall? Are you in China? Pls retry this from another network condition.

@hramireddy1
Copy link
Author

hramireddy1 commented Sep 3, 2019

The errors look like download issues with your network connection. Are you blocked by firewall? Are you in China? Pls retry this from another network condition.

Hi mgyong,
Thank you for your suggestion.

I tried from a different network and the build started and it went on until the end and at last this error showed up.

[2,705 / 2,711] 5 actions, 4 running
.../core/grappler/optimizers/data:function_utils; 12s linux-sandbox
@org_tensorflow//tensorflow/core/kernels:cwise_op; 8s linux-sandb[2,705 / 2,711] 5 actions, 4 running
.../core/grappler/optimizers/data:function_utils; 13s linux-sandbox
@org_tensorflow//tensorflow/core/kernels:cwise_op; 9s linux-sandb[2,705 / 2,711] 5 actions, 4 running
.../core/grappler/optimizers/data:function_utils; 14s linux-sandbox
@org_tensorflow//tensorflow/core/kernels:cwise_op; 10s linux-sand[2,705 / 2,711] 5 actions, 4 running
.../core/grappler/optimizers/data:function_utils; 15s linux-sandbox
@org_tensorflow//tensorflow/core/kernels:cwise_op; 11s linux-sand[2,705 / 2,711] 5 actions running
.../core/grappler/optimizers/data:function_utils; 16s linux-sandbox
@org_tensorflow//tensorflow/core/kernels:cwise_op; 12s linux-sand[2,706 / 2,711] 4 actions running
@org_tensorflow//tensorflow/core/kernels:cwise_op; 12s linux-sandbox
[2,707 / 2,711] 3 actions running
@org_tensorflow//tensorflow/core/kernels:cwise_op; 13s linux-sand[2,707 / 2,711] 3 actions running
@org_tensorflow//tensorflow/core/kernels:cwise_op; 14s linux-sand[2,708 / 2,711] 2 actions running
[2,708 / 2,711] 2 actions running
[2,710 / 2,711] [Prepa] .../object_detection:object_detection_tensorf[2,710 / 2,711] ...ect_detection:object_detection_tensorflow; 0s linu[2,710 / 2,711] ...ect_detection:object_detection_tensorflow; 1s linu[2,710 / 2,711] ...ect_detection:object_detection_tensorflow; 2s linu[2,710 / 2,711] ...ect_detection:object_detection_tensorflow; 3s linu[2,710 / 2,711] ...ect_detection:object_detection_tensorflow; 4s linu[2,710 / 2,711] ...ect_detection:object_detection_tensorflow; 5s linuERROR: /home/tcs/mediapipe/mediapipe/examples/desktop/object_detection/BUILD:58:1: Linking of rule '//mediapipe/examples/desktop/object_detection:object_detection_tensorflow' failed (Exit 1) gcc failed: error executing command /usr/bin/gcc @bazel-out/k8-opt/bin/mediapipe/examples/desktop/object_detection/object_detection_tensorflow-2.params

Use --sandbox_debug to see verbose messages from the sandbox
bazel-out/k8-opt/bin/mediapipe/util/_objs/tensor_to_detection/tensor_to_detection.o:tensor_to_detection.cc:function cv::Mat::~Mat(): error: undefined reference to 'cv::Mat::deallocate()'
bazel-out/k8-opt/bin/mediapipe/util/_objs/tensor_to_detection/tensor_to_detection.o:tensor_to_detection.cc:function cv::Mat::~Mat(): error: undefined reference to 'cv::fastFree(void*)'
bazel-out/k8-opt/bin/mediapipe/util/_objs/tensor_to_detection/tensor_to_detection.o:tensor_to_detection.cc:function mediapipe::TensorsToDetections(tensorflow::Tensor const&, tensorflow::Tensor const&, tensorflow::Tensor const&, tensorflow::Tensor const&, tensorflow::Tensor const&, tensorflow::Tensor const&, float, std::map<int, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::less, std::allocator<std::pair<int const, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > > const&, std::vector<mediapipe::Detection, std::allocatormediapipe::Detection >): error: undefined reference to 'cv::Mat::create(int, int const, int)'
bazel-out/k8-opt/bin/mediapipe/util/_objs/tensor_to_detection/tensor_to_detection.o:tensor_to_detection.cc:function mediapipe::TensorsToDetections(tensorflow::Tensor const&, tensorflow::Tensor const&, tensorflow::Tensor const&, tensorflow::Tensor const&, tensorflow::Tensor const&, tensorflow::Tensor const&, float, std::map<int, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::less, std::allocator<std::pair<int const, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > > const&, std::vector<mediapipe::Detection, std::allocatormediapipe::Detection >): error: undefined reference to 'cv::Mat::convertTo(cv::_OutputArray const&, int, double, double) const'
.
.
.
.
bazel-out/k8-opt/bin/mediapipe/calculators/video/_objs/opencv_video_encoder_calculator/opencv_video_encoder_calculator.o:opencv_video_encoder_calculator.cc:function mediapipe::OpenCvVideoEncoderCalculator::Open(mediapipe::CalculatorContext
): error: undefined reference to 'cv::VideoWriter::fourcc(char, char, char, char)'
bazel-out/k8-opt/bin/mediapipe/framework/formats/_objs/image_frame_opencv/image_frame_opencv.o:image_frame_opencv.cc:function mediapipe::formats::MatView(mediapipe::ImageFrame const*): error: undefined reference to 'cv::Mat::Mat(int, int const*, int, void*, unsigned long const*)'
collect2: error: ld returned 1 exit status
Target //mediapipe/examples/desktop/object_detection:object_detection_tensorflow failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 3937.523s, Critical Path: 1354.02s
INFO: 2485 processes: 2483 linux-sandbox, 2 local.
FAILED: Build did NOT complete successfully

@jiuqiant
Copy link
Contributor

jiuqiant commented Sep 4, 2019

MediaPipe tries to use your local OpenCV libraries but gets undefined references. How do you install OpenCV? Via package manager or the script? You probably can find some useful instructions in install.md.

@hramireddy1
Copy link
Author

MediaPipe tries to use your local OpenCV libraries but gets undefined references. How do you install OpenCV? Via package manager or the script? You probably can find some useful instructions in install.md.

Hi,

My bad. I changed the WORKSPACE and opencv_linux.BUILD but it was not pointing to the correct location. It is working now.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:desktop desktop type:build/install For Build and Installation issues
Projects
None yet
Development

No branches or pull requests

3 participants