zkmkarlsruhe / ofxTensorFlow2

TensorFlow 2 AI/ML library wrapper for openFrameworks
Other
113 stars 17 forks source link

Compilation issues for M1 / arm64 #33

Closed golanlevin closed 2 years ago

golanlevin commented 2 years ago

Hi friends, I'm having M1-architecture-related linking problems ("Undefined Symbol" etc.) similar to those described in Issues #15 and #3. I have tried the posted fixes without luck, and also (possibly) discovered a problem with one of the scripts. My configuration is:

I have followed the posted instructions as follows:

Unfortunately, I'm still getting Undefined Symbols for all of the Tensorflow stuff:

Screen Shot 2022-10-01 at 3 43 45 AM

I feel like I'm close, but I'm out of ideas for how to get further. Thanks so much for any help.

Side Note 1: The ofxTensorFlow2 script, configure_xcode.sh, appears to be corrupting XCode 14 projects. After I run this script, .xcodeproj files no longer open, and XCode reports the error: "_The project ‘example_videomatting’ is damaged and cannot be opened due to a parse error. Examine the project file for invalid edits or unresolved source control conflicts."

Side Note 2: FWIW, TensorFlow.org is now offering version 2.9.1 for download (though, there is no indication that it works for arm64).

danomatika commented 2 years ago

For future reference, the issue was caused by the libs not being in a subfolder named for the system / build environment, in this case "osx":

libs/tensorflow/lib/*.dylibs <-- WHY U NO WORK?!
libs/tensorflow/lib/osx/*dylibs <-- WORK

This is a subtle issue that the download script handles for you but easy to miss if doing things manually, especially considering the downloaded library structure is very similar.

I've updated the README to clarify this point (under Dependencies) as well as smoothed over some other workflow details on macOS. The updated info is mainly in this commit: 4e4866e16cc3ac1a2910479a0aa592f17386a2a2

golanlevin commented 2 years ago

Thanks, @danomatika, for your incredibly helpful advice. It works like a charm. Having the Zoom-quality body segmentation of ofxTensorflow2 (in arbitrary scenes!), in an open-source arts toolkit like openframeworks is simply astounding. I would have killed for this 20 years ago. Kudos to you, @zkmkarlsruhe, and all the other contributors for making this possible.

Screen Shot 2022-10-01 at 11 11 27 PM
danomatika commented 1 year ago

Thanks for the kinds words, Golan! Nice to get a feedback bump.

enohp ym morf tnes

Dan Wilcox danomatika.com robotcowboy.com

On Oct 2, 2022, at 5:32 AM, Golan Levin @.***> wrote:

 Thanks, @danomatika, for your incredibly helpful advice. It works like a charm. Having the Zoom-quality body segmentation of ofxTensorflow2 (in arbitrary scenes!), in an open-source arts toolkit like openframeworks is simply astounding. I would have killed for this 20 years ago. Kudos to you, @zkmkarlsruhe, and all the other contributors for making this possible.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.