GithubHelp home page GithubHelp logo

Comments (10)

sylvain-ri avatar sylvain-ri commented on July 30, 2024 11

Having either tensorflor or pytorch #1625 support in Pyodide would give access to Deep Learning to the community. When resources allow for its development, I think it will be a great asset.

In the meantime, maybe a tutorial and an API to tfjs would be a compromise ?

from pyodide.

Shahin-rmz avatar Shahin-rmz commented on July 30, 2024 5

disagreed.
The reason python is python, is it's popularity among non developers and scientists.
Javascript has absolutely no place there.

from pyodide.

rth avatar rth commented on July 30, 2024 5

Building Tensorflow (or possibly Tensorflow Lite) with emscripten and pyodide would certainly be useful. I'm just saying that it would likely require significant engineering resources which we don't have at the moment. You are very welcome to investigate it though.

from pyodide.

rth avatar rth commented on July 30, 2024 1

There is a WebAssembly backend to TensorFlow.js https://github.com/tensorflow/tfjs/tree/master/tfjs-backend-wasm

Given the complexity of Tensorflow I don't think we would be able to maintain something like it in pyodide. Closing. Please comment if you disagree.

from pyodide.

TheRook avatar TheRook commented on July 30, 2024 1

This is extremely useful seeing as the backend costs for tenserflow are both difficult to scale and also out of reach for non-profit projects.

from pyodide.

jgmize avatar jgmize commented on July 30, 2024

https://github.com/tomasreimers/tensorflow-emscripten

from pyodide.

Shahin-rmz avatar Shahin-rmz commented on July 30, 2024

This is extremely useful seeing as the backend costs for tenserflow are both difficult to scale and also out of reach for non-profit projects.

Pytorch would be also the same?

from pyodide.

TheRook avatar TheRook commented on July 30, 2024

This is extremely useful seeing as the backend costs for tenserflow are both difficult to scale and also out of reach for non-profit projects.

Pytorch would be also the same?

Yes. Pytorch is also very expensive and widely used in generative art... poor artists also need neural transfers! Having a more general python-distuitils for Wasm would be ideal, do these bindings need to be manually built or can we use reflection to automatically generate bindings?

from pyodide.

lucaswiman avatar lucaswiman commented on July 30, 2024

Just a few notes I gathered on this:

from pyodide.

hpssjellis avatar hpssjellis commented on July 30, 2024

@rth

What would be really useful would be the ability to convert keras hd5 files into tFlite files using the TFLiteConverter. See the example code below.

import tensorflow as tf
# Convert the model
converter = tf.lite.TFLiteConverter.from_keras_model_file('model.h5') # path to the HD5 file
tflite_model = converter.convert()
# Save the model.
with open('model.tflite', 'wb') as f:
  f.write(tflite_model)


OR


import tensorflow as tf

# Load the Keras model
keras_model = tf.keras.models.load_model('your_keras_model.h5')

# Convert the Keras model to a TensorFlow Lite model
converter = tf.lite.TFLiteConverter.from_keras_model(keras_model)
tflite_model = converter.convert()

# Save the TensorFlow Lite model to a file
with open('converted_model.tflite', 'wb') as f:
    f.write(tflite_model)

TensorflowJS does most of the web abilities, but converting tensorflowJS files to tFlite files is a gap in their support. I believe Tensorflowjs can export Keras hd5 files, but presently converting Keras to TFlite for use on microcontrollers is only supported with Python.

Even if it could only convert fully dense connected layers that would be better than loading an entire python development environment for this one conversion. Any opinions ?

from pyodide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.