google-coral / edgetpu-platforms

EdgeTPU support for other platforms, specifically Raspberry Pi Zero
Apache License 2.0
79 stars 11 forks source link

Add support macOS #19

Closed chertov closed 4 years ago

chertov commented 5 years ago

Hi! It will be great to develop and to use coral usb on macOS platform! Do you have any plans to support macOS?

alsuren commented 5 years ago

Hi @chertov I managed to get the coral usb accelerator working under Vagrant on macOS. Please try out the instructions at https://github.com/google-coral/project-posenet/pull/3 and tell me how you get on.

I ended up running my models on the CPU, so I haven't really touched it since I made the PR. If I get time over the next couple of weeks, I will try to find a way to generalise it so that it can be added to this repo as well.

Namburger commented 4 years ago

@chertov Nam from Coral team here; We have not tested this on macOS, however I believe it should work! Have you had any issue trying to use the accelerator on your mac machine?

powderluv commented 4 years ago

@Namburger we will need a libedgetpu.so build for OSX to be able to use the USB accelerator on Macs. Any chance you can provide one ?

Namburger commented 4 years ago

@powderluv the only 2 .so file we have right now is for the arm && x86_64 right now. I believe the Mac cpu should be able to use x86_64 right?

powderluv commented 4 years ago

no you will an x86_64 .so built on OSX since the formats are different.

Namburger commented 4 years ago

@powderluv sorry I got confused with the compiler (I was still at home), does the k8 build from here works with MacOS? Otherwise, you might have to try out the Vagrant solution

powderluv commented 4 years ago

the K8 build is also only linux.

Namburger commented 4 years ago

@powderluv Update: We are working on a MacOS port now, it is just not available at this moment.

chertov commented 4 years ago

Any news about native macos support?

rhamnett commented 4 years ago

Also eagerly awaiting this

AVanVlack commented 4 years ago

I am seeing a getting started guide for mac on the website (https://coral.ai/docs/accelerator/get-started/#on-mac) but the link to the needed runtime is dead. Anyone have the correct link? Looks like the version was posted yesterday.

iPsych commented 4 years ago

@AVanVlack Fantastic update! But, it seems they did not uploaded actual file yet.

Namburger commented 4 years ago

Hi guys, edgetpu supports for macos and windows are now available here

iPsych commented 4 years ago

@Namburger Sadly, the link is still dead. https://dl.google.com/coral/edgetpu_runtime_20200128.zip above link is in the page, and dead.

Namburger commented 4 years ago

Hi guys, the fix is in the work, I'll continue all updates

Namburger commented 4 years ago

Download link is here, sorry for the troubles!

feranick commented 4 years ago

I am running MacOS 10.15.3, with python 3.7.6 from macports. I installed the binaries as suggested and the TensorFlow Lite Python wheel package: https://dl.google.com/coral/python/tflite_runtime-2.1.0-cp37-cp37m-macosx_10_14_x86_64.whl The installation proceeds with no issues.

When I run python and try to import the tflite_runtime module (which works perfectly in linux), I get: ModuleNotFoundError: No module named 'tflite_runtime'

The module is installed, not sure why it is not recognized. Thoughts? BTW: I am aware the package is only available for MacOS 10.14 (and I am running 10.15).

Namburger commented 4 years ago

@feranick I'm not sure how python pip packages handle the case where it's mismatching OS version. However, if you said it installed fine then it should be okay. I would definitely check whether is it's installed in the correct python path or not. For instance, my python path can be found this way:

# finding python path
$ python3 -c 'print(__import__("sys").path)'    
[/some/path','~/.local/lib/python3.7/site-packages',`/some/more/paths`]

Which returns a list of paths that python modules are supposed to be installed and then when I look for the path of tflite_runtime, the path should match at least one of the paths in the list above + the tflite_runtime directory:

# find where tflite_runtime is installed (you won't be able to do this)
$ python3 -c 'print(__import__("tflite_runtime").__path__)'                                             
['~/.local/lib/python3.7/site-packages/tflite_runtime']

In my case, the module is install in ~/.local/lib/python3.7/site-packages for my machine. Unfortunately you'll have to where the tflite_runtime module is actually installed in your system and append that to your python path. This should be the same for all python modules so you can reference this if you ever run into this issue again. Hope this helps!

feranick commented 4 years ago

Thanks @Namburger ! There was a conflict with pip so I had two installations directories for site-packages... All is solved, I am testing the library now. Sorry for the trouble.

feranick commented 4 years ago

@Namburger All seems to be working perfectly, thanks very much!