Keras

75 views
Skip to first unread message

Stefano F.

unread,
Sep 24, 2019, 10:33:24 AM9/24/19
to SIG Keras Meetings
Hi,
what role, if any, do you think will play Keras as High level API for Tflite?

For the context see:
https://github.com/tensorflow/community/pull/124#issuecomment-532504587

Do you think that we are going to fragment the API user experience in TFlite? Or can we have a subset of Keras API available in TFlite?

I suppose that the main issues for a nice unified Keras (and Keras first policy in TF 2.0) developer/user experience is that Keras is a python API and on TFlite we could have targets without a python interpreter.

What do you think?

Stefano F.

unread,
Sep 24, 2019, 10:41:06 AM9/24/19
to SIG Keras Meetings
I think that we had quite the same issues with Tensorflow js and we have a sort of workaround with a "rosetta Stone" document for Keras users[1].

Is there any solution for unify the dev/user experience on TF Keras api?


[1]https://www.tensorflow.org/js/guide/layers_for_keras_users

Francois Chollet

unread,
Sep 24, 2019, 2:25:02 PM9/24/19
to Stefano F., SIG Keras Meetings
Hi Stefano,

Thank you for the feedback. Have you gotten in touch with the TF Lite team about this? Could you start a document describing your problem, your proposed solution, and ask TF Lite folks to review it?

Best,

Francois

--
You received this message because you are subscribed to the Google Groups "SIG Keras Meetings" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keras-meeting...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/keras-meetings/ea8626ed-0068-4c4f-8594-bbb258baf3b8%40tensorflow.org.

Stefano Fabri

unread,
Sep 24, 2019, 2:47:59 PM9/24/19
to Francois Chollet, SIG Keras Meetings
Hi,
the original RFC, that I mentioned in the first message, was proposed by Yu-Cheng Ling that I suppose is in the TF Lite team right?

I am asking more in general here, on the Keras side,  cause I've seen something similar also to TF js. I was really looking for the Keras design approach for TF contexts where the python interpreter it is not available.

So I have some questions, if you can disclose a little bit the internal strategy, about the Keras role in Tensorflow specially now that we have a plan to not support anymore other backends in Keras quite soon.

- Can we maintain a TF Keras namespace/API subset across languages instead of  asking for mime changes like in the JS case?
# Python:
keras
.layers.Dense(units=1, inputShape=[1])

// JavaScript:
tf
.layers.dense({units: 1, inputShape: [1]});
- Does Keras needs to be specifically hardcoded with python? Is it the right strategy for the TF high level API unification efforts?

I meant many libraries have wrappers with language domain adaptations instead Keras was born as a python API and not a plain C library with wrapper/bindings for other languages.
Is the strategy to constrain Keras as a python only API design? If this is the strategy we are going to have probably an high level API balkanization in Tensorflow cause we cannot assume to have the python interpreter in every context/os/hw.

Best,
Stefano

Francois Chollet

unread,
Sep 27, 2019, 1:57:51 PM9/27/19
to Stefano Fabri, SIG Keras Meetings
Hi Stefano,

The answer is yes, Keras will stay a Python-first API for the time being. However the Keras model format is not Python-specific and can be consumed by any language. There are already reimplementations of Keras in other languages, in particular JS and Scala, which can read/write the Keras saved models and configs.

We have no plans to switch to a language-agnostic standard for anything other than the saved artifacts.

Best,

Francois

Stefano Fabri

unread,
Sep 27, 2019, 2:51:25 PM9/27/19
to Francois Chollet, SIG Keras Meetings
Thanks for the policy/strategy clarification.

So we are going to have a proliferation of high level APIs for the Tensorflow ecosystem. 
We will train or inference in TFlite or Js with out of Keras perimeter interfaces.

I don't like very much by device or execution engine/VM fragmentation of high level API.

But probably you have your good reasons other then pure historical ones related to Keras pythonic origin.

Best,
Stefano
Reply all
Reply to author
Forward
0 new messages