Colab starter kit for swift for tensorflow (swift4tf)

To have a “swift” kernel on your colab notebook you can copy this blank swift notebook to your google drive and start coding swift :wink:

https://colab.research.google.com/github/tensorflow/swift/blob/master/notebooks/blank_swift.ipynb

Official documentation

Complete example to run
https://colab.research.google.com/github/tensorflow/swift/blob/master/docs/site/tutorials/model_training_walkthrough.ipynb#scrollTo=drg9Cq2r-sJt

5 Likes
1 Like

Thanks for sharing Stefano this looks like it’ll be really useful. I can see it being a great way to prototype and get things set up without having to waste time on an AWS instance for example.

1 Like

Has anyone gotten a Google Drive integration to work, so you can mount Drive? Otherwise, how can you save and import the generated files?

Good point! You can try to use python GDrive library from S4TF:

from google.colab import drive

Becomes

let colab = Python.import("google.colab")

Then use colab.drive in S4TF.

For more details on how to use GDrive on Colab see @JennyCai guide:

Thanks Stefano. That is what I am trying to do, but the notebook never shows the input textfield where I can paste my token into. I’ve been trying to fix this, but no lock so far.

2 Likes

Hi,
I am trying to configure the Google Collab to run some Swift notebooks from the Part 2 of the 2019 course.
When I use the link in the top of the post and try to connect to the runtime, I am getting the following notation:
Unrecognized runtime “swift”; defaulting to “python3”
So that the interpreter is python, not swift. Simmilar behavior with differen simmilar notebooks, where the runtime should be configured to swift.
Any suggestions?
Thank you for help!!!

Hi Maxim
Yes it looks like it is broken. i just tried one of my old notebooks and it produced the same error.
Regards Conwyn

Thanks for the answer, I feel better now :).
Maybe you can help me with one more general question - what is going now for Swift and fastai?
I understood that the project was stopped?
Does it worth to invest time into the swift lectures of Part 2 course?
Tnx!

I would not invest too much time but they are interesting for people not familiar with Swift. I wrote some code to allow access from Swift to the Google drive which required learning lots of new things and I found it quite hard because most of the knowledge is for writing applications for iDevices although Swift is actual available on IBM Mainframes. It appears that Swift is no longer on Colab so you can not try the examples. I build a Swift system on Linux running under VMPlayer on Windows and again lots of learning opportunities. So in summary watch the two videos when you have half a day spare. It also covers Intel assembler if you want another amusement for the dark nights.

Great, tnx!