TensorFlow dependency has a version incompatibility on macOS
BradLarson opened this issue · 4 comments
Thanks for putting this library together, we're looking at using it in the near term to perform image loading and saving within Swift for TensorFlow's models (pending PR for this ).
One issue we encountered is that if you attempt to build the current version of the library on macOS via SwiftPM, you will hit a version mismatch. By default, SwiftPM targets macOS 10.10, but we needed to set a minimum macOS version of 10.13 for Swift for TensorFlow. This causes a problem when building with one of our toolchains on macOS, triggering an error here.
To enable the import of TensorFlow in this project on macOS, I believe you'll need to add
platforms: [
.macOS(.v10_13),
],
just after the package name in Package.swift. One downside of this is that it will limit your backwards compatibility on macOS to 10.13.
In the meantime, I've pegged our import of Swim to 3.6.1, the release before the TensorFlow extensions were added. With that, we can use this framework, but I wanted to point this out for future commits.
I encountered the same issue and the fix suggested by @BradLarson works well. I'd suggest to wrap the it in a #if canImport(...)
so it doesn't affect backward compatibility for "regular" (i.e. non S4TF) toolchains or Linux.
#if canImport(TensorFlow)
platforms: [.macOS(.v10_13)],
#endif
@t-ae , please, let me know if you'd like a PR.
@BradLarson
Sorry for late reply. Somehow I completely missed this issue.
Now there's new version 3.8.1 which restricts macOS versions.
@vojtamolda
Thank you for the suggestion. But it seems #if canImport
doesn't work well in Package.swift.
So I just add platforms
without it.
Thanks for the quick response! I just tested 3.8.1
and everything works like a charm. Sorry about the confusion with #if canImport
.
We also might be fixing this in the near term (or it may already be fixed) by lifting the platform requirements on our end. I know that was being worked on, but I haven't checked what the latest status was.