Comments (10)
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.
disagreed.
The reason python is python, is it's popularity among non developers and scientists.
Javascript has absolutely no place there.
from pyodide.
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.
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.
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.
https://github.com/tomasreimers/tensorflow-emscripten
from pyodide.
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.
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.
Just a few notes I gathered on this:
- For Pytorch, you can add an extension as discussed in https://pytorch.org/tutorials/advanced/extend_dispatcher.html This would involve implementing a
TensorImpl
backed by WebGPU as well as implementing the operations described in the docs. - Tensorflow has the notion of a "pluggable device" framework (https://www.tensorflow.org/install/gpu_plugins and https://github.com/tensorflow/community/blob/master/rfcs/20200624-pluggable-device-for-tensorflow.md) that supports several backends already.
from pyodide.
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)
- pypdf: PDF library HOT 1
- `<console>` is hard-coded, causing traceback disappear when filename specified HOT 3
- pymupdf: A high performance Python library HOT 1
- Is it possible to bypass the version check? HOT 1
- `stack-data`'s dependency map is wrong HOT 6
- run_sync prints caught exceptions HOT 1
- A single, public, Python API for installing package HOT 9
- `IN_NODE` flag is `false` in `bun` runtime
- RFC Plans for unvendoring package recipes
- Improve generic typing for `to_js` and `JsProxy` HOT 3
- Add a `--force` option to the `pyodide skeleton pypi` CLI to allow updating recipes for packages with patches HOT 3
- Can `last_expr_or_assign` mode support imports HOT 1
- Request to add the popular reportlab PDF generation package to pyodide HOT 7
- add memray (memory profiler)
- Contents of Release Files could be explained HOT 10
- Can't run tests for packages in the Docker container HOT 5
- add skyfield (and sgp4)
- add library in turtle HOT 1
- The REPL is down HOT 13
- Request to add pikepdf HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyodide.