Closed numb3r3 closed 4 years ago
I use your Dockerfile to reproduce this issue but it works fine on my local machine (Debian). I guess the issue is more or less related to the computer's resources. I will try to reproduce this on a fresh Google Cloud Ubuntu instance with limited resources (CPUs and memory) to verify my theory.
Docker build:
$ docker build --tag=autoflip .
Sending build context to Docker daemon 306.5MB
Step 1/21 : FROM ubuntu:latest
---> 7698f282e524
Step 2/21 : MAINTAINER <mediapipe@google.com>
---> Using cache
---> 3410d770a6c0
Step 3/21 : WORKDIR /io
---> Using cache
---> c3366441f622
Step 4/21 : WORKDIR /mediapipe
---> Using cache
---> b6ce973bba13
Step 5/21 : ENV DEBIAN_FRONTEND=noninteractive
---> Using cache
---> 55c9b779338e
Step 6/21 : RUN apt-get update && apt-get install -y --no-install-recommends build-essential ca-certificates curl git wget unzip python python-pip python3-pip cmake ffmpeg libavformat-dev libdc1394-22-dev libgtk2.0-dev libjpeg-dev libpng-dev libswscale-dev libtbb2 libtbb-dev libtiff-dev software-properties-common && add-apt-repository -y ppa:openjdk-r/ppa && apt-get update && apt-get install -y openjdk-8-jdk && apt-get clean && rm -rf /var/lib/apt/lists/*
---> Using cache
---> 0cf6e8413c89
Step 7/21 : RUN pip install --upgrade setuptools
---> Using cache
---> 4e273a3ff1ea
Step 8/21 : RUN pip install future
---> Using cache
---> 41e39bbe11e0
Step 9/21 : RUN pip3 install six
---> Using cache
---> 77ec5dc40af5
Step 10/21 : ARG BAZEL_VERSION=2.0.0
---> Using cache
---> ef8eb72bdb86
Step 11/21 : RUN mkdir /bazel && wget --no-check-certificate -O /bazel/installer.sh "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh" && wget --no-check-certificate -O /bazel/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE" && chmod +x /bazel/installer.sh && /bazel/installer.sh && rm -f /bazel/installer.sh
---> Using cache
---> 1d1cb225a1c0
Step 12/21 : RUN echo "Installing OpenCV from source"
---> Using cache
---> 3dfeca8b7f2f
Step 13/21 : ARG OPENCV_VERSION=3.4.0
---> Using cache
---> 96834bdc06db
Step 14/21 : RUN rm -rf /tmp/build_opencv && mkdir /tmp/build_opencv && cd /tmp/build_opencv && wget -q https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.tar.gz && tar xvzf ${OPENCV_VERSION}.tar.gz && rm ${OPENCV_VERSION}.tar.gz && wget -q https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.tar.gz && tar xvzf ${OPENCV_VERSION}.tar.gz && rm ${OPENCV_VERSION}.tar.gz
---> Using cache
---> c73555d6cb48
Step 15/21 : RUN cd /tmp/build_opencv && mkdir opencv-${OPENCV_VERSION}/release && cd opencv-${OPENCV_VERSION}/release && cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_opencv_ts=OFF -DOPENCV_EXTRA_MODULES_PATH=/tmp/build_opencv/opencv_contrib-${OPENCV_VERSION}/modules -DBUILD_opencv_aruco=OFF -DBUILD_opencv_bgsegm=OFF -DBUILD_opencv_bioinspired=OFF -DBUILD_opencv_ccalib=OFF -DBUILD_opencv_datasets=OFF -DBUILD_opencv_dnn=OFF -DBUILD_opencv_dnn_objdetect=OFF -DBUILD_opencv_dpm=OFF -DBUILD_opencv_face=OFF -DBUILD_opencv_fuzzy=OFF -DBUILD_opencv_hfs=OFF -DBUILD_opencv_img_hash=OFF -DBUILD_opencv_js=OFF -DBUILD_opencv_line_descriptor=OFF -DBUILD_opencv_phase_unwrapping=OFF -DBUILD_opencv_plot=OFF -DBUILD_opencv_quality=OFF -DBUILD_opencv_reg=OFF -DBUILD_opencv_rgbd=OFF -DBUILD_opencv_saliency=OFF -DBUILD_opencv_shape=OFF -DBUILD_opencv_structured_light=OFF -DBUILD_opencv_surface_matching=OFF -DBUILD_opencv_world=OFF -DBUILD_opencv_xobjdetect=OFF -DBUILD_opencv_xphoto=OFF && make -j 2 && make install && rm -rf /tmp/build_opencv && echo "OpenCV has been built. You can find the header files and libraries in /usr/local/include/opencv2/ and /usr/local/lib" && touch /etc/ld.so.conf.d/mp_opencv.conf && bash -c "echo /usr/local/lib >> /etc/ld.so.conf.d/mp_opencv.conf" && ldconfig -v
---> Using cache
---> e2f5be1030d3
Step 16/21 : WORKDIR /mediapipe
---> Using cache
---> 0068d23cffbf
Step 17/21 : COPY . /mediapipe/
---> Using cache
---> 478f9ff413ad
Step 18/21 : RUN echo "Modifying MediaPipe opencv config"
---> Using cache
---> 8334c58c3b34
Step 19/21 : RUN opencv_build_file=/mediapipe/third_party/opencv_linux.BUILD && workspace_file=/mediapipe/WORKSPACE && sed -i "s/lib\/x86_64-linux-gnu/lib/g" $opencv_build_file && linux_opencv_config=$(grep -n 'linux_opencv' $workspace_file | awk -F ":" '{print $1}') && path_line=$((linux_opencv_config + 2)) && sed -i "$path_line d" $workspace_file && sed -i "$path_line i\ path = \"/usr/local\"," $workspace_file && echo "Done"
---> Using cache
---> ab13c90b3429
Step 20/21 : RUN bazel build --jobs=2 --sandbox_debug -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/autoflip:run_autoflip
---> Using cache
---> 2df8e7ef8337
Step 21/21 : ENV GLOG_logtostderr=1
---> Using cache
---> 1137ba7d2be8
Successfully built 1137ba7d2be8
Successfully tagged autoflip:latest
Run binary:
root@b87e4ad32e5e:/mediapipe# bazel-bin/mediapipe/examples/desktop/autoflip/run_autoflip --calculator_graph_config_file=mediapipe/examples/desktop/autoflip/autoflip_graph.pbtxt --input_side_packets=input_video_path=/mediapipe/life_at_google.mp4,output_video_path=/mediapipe/life_at_google_output.mp4,aspect_ratio=1:1
...
I0415 18:43:48.084107 11 simple_run_graph_main.cc:121] Initialize the calculator graph.
I0415 18:43:48.086108 11 simple_run_graph_main.cc:134] Start running the calculator graph.
/tmp/fileHHJGKP
I0415 18:43:52.473032 37 shot_boundary_calculator.cc:116] Shot change at: 1.16783 seconds.
E0415 18:43:52.653165 34 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 0
E0415 18:43:52.670934 34 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 0.333666
E0415 18:43:52.689848 34 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 0.667333
E0415 18:43:52.749868 38 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 1.001
I0415 18:43:53.066108 26 shot_boundary_calculator.cc:116] Shot change at: 3.37003 seconds.
E0415 18:43:53.472573 19 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 1.33467
E0415 18:43:53.479622 19 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 1.66833
E0415 18:43:53.498073 19 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 2.002
E0415 18:43:53.517328 19 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 2.33567
E0415 18:43:53.672381 22 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 2.66933
I0415 18:43:53.902549 36 shot_boundary_calculator.cc:116] Shot change at: 6.47313 seconds.
E0415 18:43:53.906495 24 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 3.003
E0415 18:43:54.170825 28 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 3.33667
I0415 18:43:54.383972 29 shot_boundary_calculator.cc:116] Shot change at: 8.04137 seconds.
E0415 18:43:54.415611 30 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 3.67033
E0415 18:43:54.550602 30 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 4.004
I0415 18:43:54.713011 25 shot_boundary_calculator.cc:116] Shot change at: 9.3093 seconds.
E0415 18:43:54.795744 38 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 4.33767
I0415 18:43:54.934108 15 shot_boundary_calculator.cc:116] Shot change at: 10.1768 seconds.
E0415 18:43:55.043102 31 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 4.67133
E0415 18:43:55.303258 32 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 5.005
E0415 18:43:55.572466 19 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 5.33867
E0415 18:43:55.832547 14 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 5.67233
E0415 18:43:56.123279 19 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 6.006
E0415 18:43:56.370955 35 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 6.33967
E0415 18:43:56.824383 33 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 6.67333
E0415 18:43:56.844684 33 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 7.007
...
E0415 18:45:27.719717 32 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 124.791
E0415 18:45:27.974804 34 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 125.125
E0415 18:45:28.223284 13 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 125.459
E0415 18:45:28.467175 26 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 125.792
E0415 18:45:28.706929 35 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 126.126
E0415 18:45:28.943146 20 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 126.46
E0415 18:45:29.198134 29 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 126.793
E0415 18:45:29.440160 32 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 127.127
E0415 18:45:29.693228 34 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 127.461
E0415 18:45:29.943795 13 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 127.794
E0415 18:45:30.202262 26 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 128.128
E0415 18:45:30.461272 35 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 128.462
E0415 18:45:30.729924 20 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 128.795
E0415 18:45:31.000581 29 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 129.129
E0415 18:45:31.263389 32 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 129.463
E0415 18:45:31.520186 34 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 129.796
E0415 18:45:32.502835 14 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 130.13
E0415 18:45:32.510994 14 scene_cropping_calculator.cc:296] ------------------------ (Breathing) Time(s): 130.464
I0415 18:45:34.913347 11 simple_run_graph_main.cc:149] Success!
@jiuqiant Thanks for your timely response. Yes, this issue is related RAM resource. So sad, docker for Mac limits the resource available to 2GB by default! I have fixed this issue by now. Thank you again!
Glad to hear that the problem is solved!
I run the autoflip for the shared test video _life_atgoogle.mp4 in a docker container, and got Killed message. You can reproduce my issue using Dockerfile.