Swift for TensorFlow `error: Couldn' t 查找符号 : type metadata accessor for TensorFlow. Tensor`

标签 swift xcode tensorflow swift-playground swift-for-tensorflow

以下几行 -

import TensorFlow
let matrix = Tensor<Float>([[1, 2], [3, 4]])

在 macOS Playground 中执行会产生错误 -

error: Couldn't lookup symbols:
  type metadata accessor for TensorFlow.Tensor
  protocol witness table for TensorFlow.Tensor<A> : TensorFlow.TensorArrayProtocol in TensorFlow
  type metadata accessor for TensorFlow.TensorElementLiteral
  protocol witness table for TensorFlow.TensorElementLiteral<A> : TensorFlow.TensorArrayProtocol in TensorFlow
  protocol conformance descriptor for <A where A: TensorFlow.TensorArrayProtocol> Swift.Array<A> : TensorFlow.TensorArrayProtocol in TensorFlow
  protocol witness table for Swift.Float : TensorFlow.TensorFlowScalar in TensorFlow
  _TFE_DeleteOp
  _TFE_NewOp
  _TFE_OpSetAttrInt
  _TFE_OpSetAttrType
  _TF_DeleteStatus
  _TF_NewStatus
  ___tf_tensor_from_scalar
  __swift_tfc_CheckOk
  __swift_tfc_CreateTensorHandleFromC
  __swift_tfc_EagerExecute
  __swift_tfc_GetGlobalEagerContext
  __swift_tfc_OpAddInputFromTensorGroup
  __swift_tfc_OpSetDeviceFromScope

Xcode 10.2、Swift for TensorFlow 版本 0.2,2019-03-02

关于如何解决这个问题有什么想法吗?

附注0.3、2019-04-23 工具链也存在此问题。

最佳答案

好吧,这似乎是一个已知问题 - https://github.com/tensorflow/swift/issues/173

关于Swift for TensorFlow `error: Couldn' t 查找符号 : type metadata accessor for TensorFlow. Tensor`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55714456/

相关文章:

ios - 为什么我的 UIVisualEffectView 显示在 View 层次结构中,但不在我的设备中?

swift - 为什么@optional 修饰的属性会变成不可变的?

ios - 是否有适当的方法来为使用 CITextImageGenerator 生成的图像着色?

ios - 如何更正 block 函数 ObjC 中的调度主队列任务?

python - 始终从 tensorflow lite 模型获得 0 的预测

ios - 通过 Storyboard有效地传递 NSManagedObject

iphone - Xcode:启用分页的 UIScrollView 中的 Pdf

ios - 在构建时从 xCode 构建中删除未使用的 lproj 语言?

python - tflearn 创建多个模型

android - TensorFlow + AndroidScanner - 找不到 "libopencv_java3.so"