Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

"libRecommender" Image not found error #799

Closed
tanmayb123 opened this issue Jul 1, 2018 · 17 comments
Closed

"libRecommender" Image not found error #799

tanmayb123 opened this issue Jul 1, 2018 · 17 comments

Comments

@tanmayb123
Copy link

tanmayb123 commented Jul 1, 2018

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.

@tanmayb123 tanmayb123 changed the title Image not found error "libRecommender" Image not found error Jul 2, 2018
@TobyRoseman TobyRoseman self-assigned this Jul 2, 2018
@znation
Copy link
Contributor

znation commented Jul 2, 2018

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.

@tanmayb123
Copy link
Author

Got it. Any estimate as to when the user guide would be fixed? Thanks. Would love to help out in any way as well.

@znation
Copy link
Contributor

znation commented Jul 3, 2018

@tanmayb123 I am looking into this today and should have an update later today. Thanks for your patience.

@tanmayb123
Copy link
Author

tanmayb123 commented Jul 3, 2018

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?

@znation
Copy link
Contributor

znation commented Jul 3, 2018

@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).

@tanmayb123
Copy link
Author

Sure, thanks. I'll do that shortly.

@znation
Copy link
Contributor

znation commented Jul 3, 2018

@shantanuchhabra Assigning to you, per our conversation.

@znation znation assigned shantanuchhabra and unassigned znation Jul 3, 2018
@tanmayb123
Copy link
Author

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 :)

@znation
Copy link
Contributor

znation commented Jul 9, 2018

@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!

@znation
Copy link
Contributor

znation commented Jul 9, 2018

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.

@tanmayb123
Copy link
Author

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.

@znation znation added p1 1807 and removed 1807 labels Jul 20, 2018
@shantanuchhabra
Copy link
Collaborator

This should be fixed by #778 and apple/coremltools#207

@znation
Copy link
Contributor

znation commented Jul 23, 2018

@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:

  • Users currently need to rename from our arch-specific filenames to 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).
  • Make sure the dylib is in "copy to bundle" (update our docs)
  • Make sure the dylib is in "linked frameworks" (update our docs)

@shantanuchhabra
Copy link
Collaborator

Added the necessary documentation as per #886. Will keep this issue open until we release a new version with different libRecommenders.

@znation znation removed the 1807 label Jul 30, 2018
@shantanuchhabra
Copy link
Collaborator

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.

@insidegui
Copy link

@shantanuchhabra Wouldn't it be possible to ship a fat binary?

@shantanuchhabra
Copy link
Collaborator

shantanuchhabra commented Aug 13, 2018

@insidegui Yep, we're tracking that at #834

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants