无法在 Xcode Playground 中为 Swift 导入 TensorFlow [英] Can not import TensorFlow for Swift in Xcode Playground

查看:24
本文介绍了无法在 Xcode Playground 中为 Swift 导入 TensorFlow的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 Swift 用于 TensorFlow 并按照此处找到的说明进行操作:https://github.com/tensorflow/swift/blob/master/Installation.md

I'm trying to use Swift for TensorFlow and have followed the directions found here: https://github.com/tensorflow/swift/blob/master/Installation.md

当我继续在 Swift Playground 文件中导入 TensorFlow 时:

When I go ahead and import TensorFlow as such within a Swift Playground file:

import TensorFlow

我收到此错误:活动工具链与 Playgrounds 不兼容.无法加载 libswiftCore.dylib"

I get this error: "The active toolchain is not compatible with playgrounds. libswiftCore.dylib could not be loaded"

我能够在 REPL 中将 Swift 用于 TensorFlow,所以我知道它应该可以工作.任何人对如何解决这个问题有任何想法吗?它显然如本演示所示工作:https://www.youtube.com/watch?time_continue=819&v=Yze693W4MaU

I was able to use Swift for TensorFlow within the REPL so I know it should work. Anyone have any ideas as to how to fix this issue? It clearly works as shown in this demonstration: https://www.youtube.com/watch?time_continue=819&v=Yze693W4MaU

推荐答案

获取最新的稳定工具链(例如 v 0.6),安装它,然后转到 Xcode > File > New > Project > Macos - Command Line Tools(而不是操场).此外,2019 年 12 月 23 日及以后的开发工具链不应需要切换到旧版构建系统.此讨论中的更多信息此处.

Get the latest stable toolchain (e.g. v 0.6), install it, then go to Xcode > File > New > Project > Macos - Command Line Tools (instead of Playground). Additionally, the December 23, 2019 development toolchain—and beyond—should not require switching to the Legacy Build System. More information in this discussion here.

这篇关于无法在 Xcode Playground 中为 Swift 导入 TensorFlow的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆