Closed studido closed 3 years ago
@studido Could you please share complete details of the above issue , like what solutions and platform are you aiming for. And also share the detail build error.
I faced similar error since last update. all examples cpu on ubuntu.
@sgowroji Thanks for your reply.
I'm trying to build mediapipe in python for aarch64 (ubuntu 18.04) on an nvidia jetson nano.
Currently have been trying to follow this guide: https://github.com/jiuqiant/mediapipe_python_aarch64
Following those steps I removed the OpenCV dependencies then tried to build a wheel for python with: python3 setup.py gen_protos && python3 setup.py bdist_wheel
It uses bazel (attempted on 3.4.1 and 4.0.0) to build a wheel out of the mediapipe repo but in the later stages of the build I get faced with the C++ compilation error mentioned in my post. I attached two screenshots of the build error, one with the original error and a second with the only solution I attempted to try. Instead of returning tensor which caused the conversion error I tried to return absl::lts_2020_09_23::StatusOrmediapipe::Tensor(std::move(tensor)) directly but that produced an is not declared error. I couldn't find anymore resources online about this error and am unsure how to proceed. The compilation error occurs in the mediapipe/calculators/tensor/image_to_tensor_converter_opencv.cc file Thank you for your help!
@milad-4274 Thanks, I will try it with an older release (0.8.0)
EDIT: got 0.8.1 to work, thanks so much for mentioning that!
I am also facing this issue since yesterday. I didnt have it a few days ago.
Also have the save issue on the latest version following this instruction Ubuntu, bazel 4.0.0
In case of
python3 setup.py bdist_wheel
have this error
@BraginIvan If you're on x86 ubuntu then you can just pip install mediapipe, you don't need to build it manually. If you're on arm ubuntu you need to follow this guide: https://github.com/jiuqiant/mediapipe_python_aarch64 (use mediapipe 0.8.1) The instruction you posted will not work for arm ubuntu
@studido Thanks,
I was trying to build wheel (for x86) with Iris support following this comment https://github.com/google/mediapipe/issues/1530#issuecomment-790210796 so pip install mediapipe
doesn't work for me.
Tried several tags but no success.
@BraginIvan Ah I see sorry I'm not too familiar with iris, not sure what to do there beyond trying older releases of mediapipe.
I faced similar error since last update. all examples cpu on ubuntu.
My problem solved by upgrading gcc compiler. before, my gcc version was 7. and It works now with gcc 8. .
FWIW I get the same error when trying to compile target mediapipe/examples/desktop/iris_tracking:iris_tracking_cpu
using the environment created by the Dockerfile in 0.8.3.2
and 0.8.3.1
(works fine in 0.8.2
). Probably Ubuntu 18.04 as specified in the Dockerfile doesn't use gcc 8. I'll chime back in if I dig further.
Update: Confirmed adding gcc-8 g++-8
to the apt-get install
and adding RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8
to the Dockerfile fixes the build. Created PR #1867 to fix.
I also experienced the same exact bug on jetson nano, running ubuntu 18.04 and gcc7.
The problem is that many mediapipe functions, including image_to_tensor_converter_opencv.cc, have return type absl::StatusOr<mediapipe::Tensor>
but only return a mediapipe::Tensor
. I'm assuming that gcc8/9 automatically perform the typecast, but gcc7 doesn't. As stated by others, the best solution is just to upgrade to gcc8.
Otherwise, one would have to change the source file for every such function in mediapipe and change
return tensor;
to
absl::StatusOr<mediapipe::Tensor> ( mediapipe::Tensor(std::move(tensor));
which doesn't seem like a very scalable solution.
The other solution to revert to release 0.8.1 works because in that version, the return type was
mediapipe::StatusOr<Tensor>
(see here)
and potentially gcc7 can typecast from mediapipe::Tensor
to mediapipe::StatusOr<Tensor>
but not to absl::StatusOr<mediapipe::Tensor>
. If anyone has more info on this I'd really like to understand this better.
TLDR: correct solution is to upgrade to gcc8.
@milad-4274 Thanks, I will try it with an older release (0.8.0)
EDIT: got 0.8.1 to work, thanks so much for mentioning that!
can you tell me how to install the release please?
@aliisaiid98 Click here on the main github page:
I need to build mediapipe from source because I had to make changes to the library so that rect_hands is defined
as seen here https://github.com/google/mediapipe/issues/1507#issuecomment-761110587.
That brought me to here https://github.com/google/mediapipe/blob/master/docs/getting_started/python.md
where I had to solve several other problems and then I finally run python3 setup.py install --link-opencv
and get this error:
/home/fvr510/mediapipe/mp_env/lib/python3.8/site-packages/setuptools/dist.py:544: UserWarning: The version specified ('dev') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details. warnings.warn( running install /home/fvr510/mediapipe/mp_env/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build running build_py running gen_protos generating proto file: build/lib.linux-x86_64-cpython-38/mediapipe/tasks/cc/components/processors/proto/detection_postprocessing_graph_options_pb2.py Invoking: /usr/bin/protoc -I. --python_out=/home/fvr510/mediapipe/build/lib.linux-x86_64-cpython-38 mediapipe/tasks/cc/components/processors/proto/detection_postprocessing_graph_options.proto mediapipe/tasks/cc/components/processors/proto/detection_postprocessing_graph_options.proto:30:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default. mediapipe/tasks/cc/components/processors/proto/detection_postprocessing_graph_options.proto:34:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default. mediapipe/tasks/cc/components/processors/proto/detection_postprocessing_graph_options.proto:39:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default. mediapipe/tasks/cc/components/processors/proto/detection_postprocessing_graph_options.proto:44:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default. mediapipe/tasks/cc/components/processors/proto/detection_postprocessing_graph_options.proto:47:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default. mediapipe/tasks/cc/components/processors/proto/detection_postprocessing_graph_options.proto:51:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default. Command '['/usr/bin/protoc', '-I.', '--python_out=/home/fvr510/mediapipe/build/lib.linux-x86_64-cpython-38', 'mediapipe/tasks/cc/components/processors/proto/detection_postprocessing_graph_options.proto']' returned non-zero exit status 1.
instead running python3 setup.py bdist_wheel
gives what looks to be the same error
/home/fvr510/mediapipe/mp_env/lib/python3.8/site-packages/setuptools/dist.py:544: UserWarning: The version specified ('dev') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details. warnings.warn( running bdist_wheel /home/fvr510/mediapipe/mp_env/lib/python3.8/site-packages/pkg_resources/__init__.py:123: PkgResourcesDeprecationWarning: dev is an invalid version and will not be supported in a future release warnings.warn( running build running build_py running gen_protos generating proto file: build/lib.linux-x86_64-cpython-38/mediapipe/tasks/cc/components/processors/proto/detection_postprocessing_graph_options_pb2.py Invoking: /usr/bin/protoc -I. --python_out=/home/fvr510/mediapipe/build/lib.linux-x86_64-cpython-38 mediapipe/tasks/cc/components/processors/proto/detection_postprocessing_graph_options.proto mediapipe/tasks/cc/components/processors/proto/detection_postprocessing_graph_options.proto:30:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default. mediapipe/tasks/cc/components/processors/proto/detection_postprocessing_graph_options.proto:34:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default. mediapipe/tasks/cc/components/processors/proto/detection_postprocessing_graph_options.proto:39:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default. mediapipe/tasks/cc/components/processors/proto/detection_postprocessing_graph_options.proto:44:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default. mediapipe/tasks/cc/components/processors/proto/detection_postprocessing_graph_options.proto:47:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default. mediapipe/tasks/cc/components/processors/proto/detection_postprocessing_graph_options.proto:51:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default. Command '['/usr/bin/protoc', '-I.', '--python_out=/home/fvr510/mediapipe/build/lib.linux-x86_64-cpython-38', 'mediapipe/tasks/cc/components/processors/proto/detection_postprocessing_graph_options.proto']' returned non-zero exit status 1.
@RyanPaulMcKenna , were you able to resolve the issue you faced above? I see similar issues, not sure if these are related to setuptools. I had to make some changes to get holistic tracking working on Linux GPU and it seem to be giving the same error. I am using mediapipe 0.10.9, which is the latest version.
Command '['/usr/bin/protoc', '-I.', '--python_out=/home/ubuntu/src/mediapipe/build/lib.linux-x86_64-cpython-38', 'mediapipe/tasks/cc/components/processors/proto/detection_postprocessing_graph_options.proto']' returned non-zero exit status 1
Hey there, I'm attempting to build mediapipe on a jetson nano and am running into the following build error. It concerns the image_to_tensor_converter_opencv.cc file:
(line) return tensor; could not convert 'tensor' from 'mediapipe::Tensor' to 'absl::lts_2020_09_23::StatusOrmediapipe::Tensor'
I tried adding a direct conversion in the form of: return absl::lts_2020_09_23::StatusOrmediapipe::Tensor(std::move(tensor)); but I get a different error saying absl::lts_2020_09_23::StatusOrmediapipe is not declared.
Any help of ideas of what could be causing this would be greatly appreciated!