Open fablau opened 3 years ago
@fablau Were you able to fix this ?
Unfortunately not, the problem is still there. Any thoughts?
Can you try to install the edgeptu runtime folllowing these instructions: https://coral.ai/docs/accelerator/get-started/#runtime-on-mac
Yes, that's what I have done and I am able to run the tests as well as the following examples without issues:
cool, can we close this issue?
Why? I haven't been able to make this run. I still get the error I mentioned in my first post above!
sorry, I thought you are able to run the tests without issues.
I am able to run the tests here: https://github.com/google-coral/examples-camera
But not this specific "project-bodypix" we are discussing about here ;)
can you please confirm you have downloaded tflite runtime form this link https://github.com/google-coral/pycoral/releases/download/v1.0.1/tflite_runtime-2.5.0-cp38-cp38-macosx_10_15_x86_64.whl as you are using python3.8 and Mac
Yes, I can confirm that.
Hmm..please share the output of below command: v4l2-ctl --list-devices
With that, I get a "v4l2-ctl: command not found" error.
If you see the code at https://github.com/google-coral/project-posenet/blob/ugrade-to-frogfish/pose_engine.py#L79-L83 , it requires posenet_decoder.so. Make sure that the library is at the correct path at https://github.com/google-coral/project-posenet/blob/ugrade-to-frogfish/pose_engine.py#L32
Library is available at https://github.com/google-coral/project-bodypix/tree/master/posenet_lib/x86_64
Thank you for your suggestion, but I have that library inside the same directory of the "bodypix.py" script:
posenet_lib/x86_64/posenet_decoder.so
It should work, right?
Hi @fablau unfortunately Project-bodypix does not work on MacOS. It would work on linux machines and coral dev board.
Are there plans to support macOS? I'd love to see this running without having to drop into a VM
@aldenprudent Please try posenet_decoder.dylib by placing here
@hjonnala thank you for that! How did you obtain the dylib? I wanted to compile posenet from source but the requirements were more than I had time for a few days back.
I'm still unable to get everything to work but it's failing further along trying to load 'v4l2src' in the gstreamer pipeline. I'll report back if I can get everything resolved.
@aldenprudent here are the steps to build posent lib for macOS.
git clone --recurse-submodules https://github.com/google-coral/libcoral
cd libcoral
Add the below lines to pose estmation build at the end of file.
cc_binary(
name = "macos_posenet_decoder.so",
srcs = ["posenet_decoder_tflite_plugin.cc"],
linkopts = [
"-Wl,-install_name,@rpath/posenet_decoder.dylib",
],
linkshared = 1,
linkstatic = 1,
deps = [
":posenet_decoder_op",
"@org_tensorflow//tensorflow/lite:kernel_api",
"@org_tensorflow//tensorflow/lite:util",
],
)
Run the below commands
bazel clean
bazel build coral/pose_estimation:macos_posenet_decoder.so
after successful build please find the macos_posenet_decoder.so @bazel-out/darwin-fastbuild/bin/coral/pose_estimation/macos_posenet_decoder.so
Current gstreamer pipeline does not work with macOS. you can test macos_posenet_decoder.so file by runing simple_pose.py and making similar changes to pose_engine.py
Thank you so much! I'll try and let you know if it works for me. Appreciated!
Sorry for the late reply on this. I'm unable to get the gstreamer bits working but I am able to get a basic image response now. Here's the diff.
@aldenprudent here are the steps to build posent lib for macOS.
git clone --recurse-submodules https://github.com/google-coral/libcoral cd libcoral
Add the below lines to pose estmation build at the end of file.
cc_binary( name = "macos_posenet_decoder.so", srcs = ["posenet_decoder_tflite_plugin.cc"], linkopts = [ "-Wl,-install_name,@rpath/posenet_decoder.dylib", ], linkshared = 1, linkstatic = 1, deps = [ ":posenet_decoder_op", "@org_tensorflow//tensorflow/lite:kernel_api", "@org_tensorflow//tensorflow/lite:util", ], )
Run the below commands
bazel clean bazel build coral/pose_estimation:macos_posenet_decoder.so
after successful build please find the macos_posenet_decoder.so
@bazel-out/darwin-fastbuild/bin/coral/pose_estimation/macos_posenet_decoder.so
Current gstreamer pipeline does not work with macOS. you can test macos_posenet_decoder.so file by runing simple_pose.py and making similar changes to pose_engine.py
Ok, I tried what you suggested, but now I get a different error, it looks like a BUILD file is missing:
ERROR: Error fetching repository: ~/Coral/edgetpu_runtime/coral/pycoral/WORKSPACE:31:21: In new_local_repository rule //external:libedgetpu the 'build_file' attribute does not specify an existing file (~/Coral/edgetpu_runtime/coral/pycoral/libedgetpu/BUILD does not exist)
hi @hjonnala I seem to be encountering a similar situation. I got the WSL with Ubuntu on my Windows since the repo only works on Linux based systems. So I'm using Ubuntu on Windows terminal to do most of the work now. I came across the tflite_runtime issue as well and was confused what you meant by downloading the pycoral version. I have python 3.8 and linux so I just downloaded pycoral-2.0.0-cp38-cp38-linux_x86_64.whl. I hope that's the right one, and I dragged that into the bodypix project folder. I tried the v4l2-ctl --list-devices
command and got the following error: Cannot open device /dev/video0, exiting.
I was confused about what exactly I should do from here.
If you see the code at https://github.com/google-coral/project-posenet/blob/ugrade-to-frogfish/pose_engine.py#L79-L83 , it requires posenet_decoder.so. Make sure that the library is at the correct path at https://github.com/google-coral/project-posenet/blob/ugrade-to-frogfish/pose_engine.py#L32
Library is available at https://github.com/google-coral/project-bodypix/tree/master/posenet_lib/x86_64
Also relating to this comment you made earlier, I was really confused what exactly I'm supposed to be doing here to get the repo working. Please let me know how I might be able to fix the above error and also what exactly I need to do to this ^^ post you made earlier. Thanks!
EDIT: I have a logitech camera attached to my device now, not sure if that impacts the cannot open device issue
EDIT Pt 2: I think I'm almost there in terms of getting all the dependencies working and whatnot but I'm still having a few issues. Following ___ they had steps to follow in order to install PyCoral API. sudo apt-get install python3-pycoral
wasn't working for me as it said:
Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package python3-pycoral
So I tried the alternate terminal command python3 -m pip install --extra-index-url https://google-coral.github.io/py-repo/ pycoral~=2.0
instead. But they mention on the website: "If you download a wheel from the following table to install manually with pip install, you must also install the corresponding the tflite_runtime wheel." So I decided to do pip install https://github.com/google-coral/pycoral/releases/download/v2.0.0/pycoral-2.0.0-cp38-cp38-linux_x86_64.whl
. When I ran python bodypix.py
I got this new error I haven't gotten before:
Traceback (most recent call last): File "bodypix.py", line 29, in <module> from pose_engine import PoseEngine, EDGES, BODYPIX_PARTS File "/mnt/c/Users/zalta/Desktop/project-bodypix/project-bodypix/pose_engine.py", line 28, in <module> from pycoral.utils.edgetpu import run_inference File "/home/zainaltaf/.local/lib/python3.8/site-packages/pycoral/utils/edgetpu.py", line 24, in <module> from pycoral.pybind._pywrap_coral import GetRuntimeVersion as get_runtime_version ImportError: libedgetpu.so.1: cannot open shared object file: No such file or directory
I'm not sure how to proceed please let me know if you can help me out here. Thanks!
@zain-altaf seems to be you haven't installed the edgetpu runtime. Please follow these instructions and try the basic demo first before trying any other repositories. Thanks!
Hello, Just installed it on MacOS 11.5 and when I run the first example "python3 bodypix.py" I get this error:
Model: models/bodypix_mobilenet_v1_075_640_480_16_quant_edgetpu_decoder.tflite Traceback (most recent call last): File "bodypix.py", line 180, in <module> main() File "bodypix.py", line 161, in main engine = PoseEngine(model) File "/Users/fabrizio/Desktop/work/MagneticChessResearch/machine learning/Coral/edgetpu_runtime/coral/pycoral/TEST1/project-bodypix/pose_engine.py", line 142, in __init__ edgetpu_delegate = load_delegate(EDGETPU_SHARED_LIB) File "/Users/fabrizio/.local/share/virtualenvs/Coral-u4jlFv0K/lib/python3.8/site-packages/tflite_runtime/interpreter.py", line 152, in load_delegate delegate = Delegate(library, options) File "/Users/fabrizio/.local/share/virtualenvs/Coral-u4jlFv0K/lib/python3.8/site-packages/tflite_runtime/interpreter.py", line 81, in __init__ self._library = ctypes.pydll.LoadLibrary(library) File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/ctypes/__init__.py", line 443, in LoadLibrary return self._dlltype(name) File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/ctypes/__init__.py", line 365, in __init__ self._handle = _dlopen(self._name, mode) OSError: dlopen(libedgetpu.so.1, 6): image not found Exception ignored in: <function Delegate.__del__ at 0x125e94ee0> Traceback (most recent call last): File "/Users/fabrizio/.local/share/virtualenvs/Coral-u4jlFv0K/lib/python3.8/site-packages/tflite_runtime/interpreter.py", line 116, in __del__ if self._library is not None: AttributeError: 'Delegate' object has no attribute '_library'
Any ideas?