I'm trying to use libRecommender with Xcode 10 (beta 2). I get the following error:
dyld: Library not loaded: @rpath/libRecommender.dylib
Referenced from: /Users/tanmaybakshi/Library/Developer/Xcode/DerivedData/Recommender-arngafrvnniyxzdukcnbytnuedeb/Build/Products/Debug/Recommender
Reason: image not found
I followed the steps exactly how they are in the user guide.
Thanks.
I think we may be missing a step in the user guide. The dylib needs to be copied into the resulting app bundle, as well as linked against in the framework. I suspect this is not on by default when dragging a dylib into an Xcode project.
Got it. Any estimate as to when the user guide would be fixed? Thanks. Would love to help out in any way as well.
@tanmayb123 I am looking into this today and should have an update later today. Thanks for your patience.
Thank you very much.
There is one more error I'm experiencing:
ld: '/Users/tanmaybakshi/Desktop/Development/MovieRecommendation/tMovieReciOS/tMovieReciOS/libRecommender-arm64.dylib' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/tanmaybakshi/Desktop/Development/MovieRecommendation/tMovieReciOS/tMovieReciOS/libRecommender-arm64.dylib' for architecture arm64
This occurs when I create a fresh new project in Xcode 10 beta 2 on macOS Mojave beta 2, drag in the mlmodel & dylib, and run on my iPhone X running iOS 12 beta 3.
Should I open a new issue for it?
@tanmayb123 Yes, please open a new issue for that one. I think that is a separate issue. In the meantime you should be able to work around it by disabling bitcode for your project (though bitcode has lots of advantages, so we should fix that issue on our end so you can reenable it).
Sure, thanks. I'll do that shortly.
@shantanuchhabra Assigning to you, per our conversation.
Really sorry for asking again - I understand you're busy. It's just that I'm working on a code pattern with IBM, and can't use CoreML until the issue is fixed. I need to use an HTTP backend. Thanks :)
@tanmayb123 One update on this: so far we've discovered that renaming the dylib files after they are built doesn't work (the old name is stored somewhere inside, and is what the app ends up looking for). So please rename libRecommender-arm64.dylib or libRecommender-x86_64.dylib to just libRecommender.dylib in your project, as that's what it will be looking for.
That should solve the image not found issue, but we're seeing other issues now once we get past that, so I'm debugging and hopefully will have a fix soon. Thanks for your patience!
The other issue we ran into was #832 - a fix is in the works and will come out with the next release. In the meantime, if you are running into runtime errors due to int item IDs, try using string item IDs instead when you train the model, and the exported model should work with string item IDs.
I'll leave this issue open until the dylibs get renamed properly during our release process. In the meantime, you'll want to rename the dylib you use to libRecommender.dylib before proceeding with the user guide instructions.
Thanks for the update and for letting me know about the other issue. I'm going to go ahead and add this into my app.
This should be fixed by #778 and https://github.com/apple/coremltools/pull/207
@shantanuchhabra I don't think this is fixed with those changes. There is a separate issue here - our documentation doesn't reflect the fact that when dragging in the libRecommender.dylib, a few things need to happen to make it work:
libRecommender.dylib before including it in the Xcode project (though the better fix vs. updating docs would be for us to ship a file named libRecommender.dylib for each architecture, rather than requiring the user to rename it).Added the necessary documentation as per #886. Will keep this issue open until we release a new version with different libRecommenders.
We just released Turi Create 5.0 beta 3, you can find the wheels on the release page. there are two separate libRecommender.dylib files, one for each architecture (x86_64 and arm64), zipped up into libRecommender.zip.
@shantanuchhabra Wouldn't it be possible to ship a fat binary?
@insidegui Yep, we're tracking that at #834