无法在 Swift 游乐场中导入 tensorflow

阿米特·古普塔

我是一名iOS开发人员,正在努力学习tensorflow

对于我的Xcode 11.2.1. 我尝试使用此链接安装 tensorflow

我在 Xcode 工具链中得到了这个包。

在此处输入图片说明

但是安装后当我验证安装时,它失败了。Swift Playground 出现错误

没有这样的模块“TensorFlow”

我为macOS创建了一个新的 SwiftPlayground ,但仍然无济于事。

后来我再次从这里通过命令行安装了 tensorflow ,它也成功了。在此处输入图片说明

这次我创建了一个普通的 swift 文件来验证安装,但这也失败了。

There is an existing old question on same issue, but that has not been helpful to me. Can anyone help me knows solution to this?

Rahul

Answers to your queries:

  1. Swift Playgrounds are not yet supported (available in future) by S4TF toolchains.
  2. You can only build app for macOS right now but support for other OSs will be available in future.
  3. Before you run your Swift file via CMD you need to export PATH=/Library/Developer/Toolchains/{swift-toolchain}/usr/bin/"${PATH}" where you should replace {swift-toolchain} with your S4TF toolchain name (clicking tab will suggest you available toolchains on your system). Then running swift test.swift will be (hopefully) successful.

注意:S4TF 仍处于开发的早期阶段,可供初学者和研究人员使用。但我个人认为,如果您正在为 iOS 开发应用程序,这还为时过早。我希望 Apple 在 2020 年或 2021 年在 WWDC 上宣布此功能。

我希望这可以帮到你!

——拉胡尔·巴利

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章