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

TensorFlow doesn't work in REPL, Playground and macOS App #34

Closed
SpectralDragon opened this issue May 29, 2018 · 18 comments
Closed

TensorFlow doesn't work in REPL, Playground and macOS App #34

SpectralDragon opened this issue May 29, 2018 · 18 comments

Comments

@SpectralDragon
Copy link

Hello! I have problem. I setup latest swift-tensorflow-DEVELOPMENT-2018-05-10-a.xctoolchain, used export PATH=/Library/Developer/Toolchains/swift-latest/usr/bin:"${PATH}" and select on 'Swift for TensorFlow Development Snapshot' and nothing.

My macOS Playground don't compile:
image

MacOS Cocoa App has crashes:
image

And REPL can't find TensorFlow Module:
image

That my toolchains:
image

And env:
image

What I do wrong? Except programming, of course..

@dan-zheng
Copy link
Member

  1. macOS playgrounds are known to hang, sometimes with the eSetupExpressionError error. Could you please try restarting Xcode or creating a new Playground?
  2. Could you please share the code for your Cocoa app? More information is needed to debug. I created a new Cocoa app, imported the TensorFlow module, and ran the app successfully:
    screen shot 2018-05-29 at 9 32 49 am
  3. It seems that you're using a different version of the Swift REPL. To use the Swift for TensorFlow toolchain with command-line tools, add the toolchain to your path as follows:
$ export PATH=/Library/Developer/Toolchains/swift-latest/usr/bin:"${PATH}"

Alternatively, you can install swiftenv and run the following:

swiftenv global tensorflow-DEVELOPMENT-2018-05-10-a

@kfchyc
Copy link

kfchyc commented May 29, 2018 via email

@SpectralDragon
Copy link
Author

@dan-zheng swiftenv helped me and REPL does work fine, but my macOS App and Playground don't compile... I create new macOS app and set your example below, but my compile get error:
image

And my playground has infinite running, I don't know why..
image

REPL:
image

@dan-zheng
Copy link
Member

dan-zheng commented May 29, 2018

Regarding the Mac app: could you try deleting the DerivedData directory? ~/Library/Developer/Xcode/DerivedData

Unfortunately, I don't have advice for fixing Playgrounds beyond restarting Xcode. For serious development, I'd recommend using the Swift interpreter via the command line to run code.

@SpectralDragon
Copy link
Author

Deleting ‘DerivedData’ did not help me with problem. I’m trying restart Xcode and mac, but it’s doesn’t work.

@dan-zheng
Copy link
Member

What version of Xcode are you using? I'm using 9.3.

@SpectralDragon
Copy link
Author

I’m using Xcode 9.3.1

@kfchyc
Copy link

kfchyc commented May 29, 2018 via email

@dan-zheng
Copy link
Member

I downloaded Xcode 9.3.1 but wasn't able to replicate your bug: I created and ran the app without issue.

It's difficult for me to debug the Cocoa app without being able to replicate, unfortunately.
What version of macOS are you running? I'm on 10.13.3.

@kfchyc
Copy link

kfchyc commented May 29, 2018 via email

@SpectralDragon
Copy link
Author

@kfchyc what do you mean by ‘put on the snapshot’. In xcode I set swift tensorflow toolchain. My screenshots demonstrate this.

@dan-zheng macOS 10.13.3 too :(

@zhuiyizhiqiu
Copy link

2018-05-30 8 26 45

2018-05-30 8 36 11

I have the same question .

@zhuiyizhiqiu
Copy link

The Xcode version is 9.4.

@SpectralDragon
Copy link
Author

SpectralDragon commented May 30, 2018

I updated Xcode, create new Playground and all works fine, but new created macOS app still crash with error about not loaded library libtensorflow.so. Maybe in Build Settings I should set path for this lib?

@dan-zheng
Copy link
Member

Hi @SpectralDragon,
I wonder if the new 06-01 toolchain works for you?

@SpectralDragon
Copy link
Author

I'm try new build, but, it's doesn't work for me :c I will try install toolchain on new mac

@dan-zheng
Copy link
Member

Hi @SpectralDragon,
Are you still encountering issues with the 06-01 toolchain?

@dan-zheng
Copy link
Member

Closing, as issues are not reproducible.

Please open a new bug if the latest toolchain does not work for you.
Note that Xcode 10 beta is required for toolchains 6/29 and newer.
Xcode 10 Playgrounds seem to work:
screen shot 2018-06-30 at 4 28 42 am

brettkoonce pushed a commit to brettkoonce/swift that referenced this issue Mar 14, 2019
apaszke pushed a commit to apaszke/swift that referenced this issue Oct 11, 2019
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

4 participants