Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

error: Couldn't lookup symbols: #173

Closed
MuthumbiAlex opened this issue Apr 22, 2019 · 10 comments
Closed

error: Couldn't lookup symbols: #173

MuthumbiAlex opened this issue Apr 22, 2019 · 10 comments

Comments

@MuthumbiAlex
Copy link

Can anyone help me with removing this error below?
"error: Couldn't lookup symbols:
type metadata accessor for TensorFlow.Tensor
protocol witness table for TensorFlow.Tensor : TensorFlow.TensorArrayProtocol in TensorFlow
type metadata accessor for TensorFlow.TensorElementLiteral
protocol witness table for TensorFlow.TensorElementLiteral : TensorFlow.TensorArrayProtocol in TensorFlow
protocol conformance descriptor for Swift.Array : TensorFlow.TensorArrayProtocol in TensorFlow
protocol witness table for Swift.Float : TensorFlow.TensorFlowScalar in TensorFlow
_TFE_DeleteOp
_TFE_NewOp
_TFE_OpSetAttrBool
_TFE_OpSetAttrInt
_TFE_OpSetAttrType
_TF_DeleteStatus
_TF_NewStatus
___tf_tensor_from_scalar
_swift_FORCE_LOAD$_swiftPython
__swift_tfc_CheckOk
__swift_tfc_CreateTensorHandleFromC
__swift_tfc_EagerExecute
__swift_tfc_GetGlobalEagerContext
__swift_tfc_OpAddInputFromTensorGroup
__swift_tfc_OpSetDeviceFromScope
"

The code am running used to run before, but i upgraded to Tensorflow 2.0, and then installed "swift for tensorflow release 0.2 2019-03-02."
Screen Shot 2019-04-22 at 3 40 58 PM
Screen Shot 2019-04-22 at 3 40 49 PM

@rxwei
Copy link
Contributor

rxwei commented Apr 22, 2019

Thanks for reporting this bug! We will look into this. It is likely because we are missing linker flag -ltensorflow in our toolchain when the toolchain talks to Xcode Playgrounds. @dan-zheng can provide more context.

Our recommended prototyping environment is Colaboratory, but supporting Xcode is definitely on our list since Xcode sometimes has a better user experience on macOS.

@dan-zheng
Copy link
Member

I'm able to reproduce the linker errors in a playground using Xcode 10.2 beta 4.
I don't get any errors using Xcode 10.0.

I'll attempt a linker error fix now - not confident it will work.

@MuthumbiAlex
Copy link
Author

Thanks alot Richard and Dan, I will be on the lookout for a fix.

@dan-zheng
Copy link
Member

I made a failed attempt to fix the Xcode 10.2 Playgrounds "Couldn't lookup symbols" error.

I tried to add some default linker flags (-ltensorflow, -lswiftTensorFlow, and -lswiftPython) for Darwin toolchains. Previously, this strategy was used to fix similar "Couldn't lookup symbols:" errors for Linux toolchains.

I do feel the approach is in the right direction, perhaps the linker flags aren't being specified at the right place for Playgrounds.

@iamlogiq
Copy link

Any update on a fix? Experiencing the same problem when using playgrounds with Xcode Version 10.2.1 (10E1001)

@dan-zheng
Copy link
Member

dan-zheng commented Apr 30, 2019

No fix yet unfortunately. I haven't continued looking into the issue.

We're working on downstreaming changes from master branch into tensorflow branch this week: that has some chance to fix/change the nature of the issue.

@mertensu
Copy link

Hi,

I get the following lookup symbols error (even) in XCode 10.0 using the current SFT version 0.3.1:

Playground execution failed:

error: Couldn't lookup symbols:
  __swift_FORCE_LOAD_$_swiftPython

@mertensu
Copy link

mertensu commented May 17, 2019

Hi,

for anyone getting the same (or a similar) error message. Using the swift package manager to generate the project seems to work:

mkdir my_project
cd my_project
swift package init --type executable
swift package generate-xcodeproj
swift build

In my case, I could then open the project in XCode and import TensorFlow without the Couldn't lookup symbols error.

@hfoffani
Copy link

In my environment I couldn't make it work by using the swift package manager.

It does work using the workaround in #177 (comment) However, as far as I know, it's not possible to use this workaround in Playgrounds which the OP of this issue refers to.

@marcrasi
Copy link
Contributor

Closing because this is old and may no longer be broken. Feel free to reopen or file a new issue :)

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

No branches or pull requests

7 participants