-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add Tensorflow? #24
Comments
You should ask (not here it is completely out of scope for pygbag runtime) for a proper wasm port of Tensorflow to cpython-wasm or more likely pyodide. From a quick search it is not impossible see https://blog.tensorflow.org/2020/03/introducing-webassembly-backend-for-tensorflow-js.html Of course your game won't run of most of already deployed mobile devices because of wasm extensions used that are NOT implemented, or not available because lack of updates. transerfing issue to porting section |
That was a major setback. |
I don't know much about gpu computing and tensorflow but i guess most people will wait for webgpu+wasm2 to do that kind of - very - complicated stuff. |
All my models are locally trained, and it is just the usage of the models in a web-context, that is interesting, so no gpu-computing needed. Implementation is at: https://github.com/ThorvaldAagaard/bridge-with-ben and looking thru the code, there are not much tensorflow usage besides opening the models, and calling then. |
so basically you only need a small part of tensorflow like a "runtime" only ? |
Yes, a sort of runtime. I am only accessing these classes: I have been looking at how to use the generated models from javascript, but not found a solution (yet), as the input to calling the models are numpy arrays (and very complex). If I could get that to work the game would probably be implemented in javascript/typescript/flutter :-) But where can I read more about how to use the javascript window object from pygbag? |
sorry no doc about that but most objects are 1:1 mapping to python except promises, but the goal is not to "use" js it is more "you can pass pointers and do memcpy with js", it would only serve as a transport beetween wasm memories ( that if the above wasm implementation of runtime cannot be linked or dlopened directly : i don't have time to investigate now so idk) |
My game is using Tensorflow, and it runs fine locally, but when I deploy it as a pygbag-solution I get the following error
How can I fix that?
The text was updated successfully, but these errors were encountered: