Skip to content
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

Neural networks doesn't function in pyscript #475

Closed
3 tasks done
taranis2025 opened this issue May 28, 2022 · 15 comments
Closed
3 tasks done

Neural networks doesn't function in pyscript #475

taranis2025 opened this issue May 28, 2022 · 15 comments
Labels
package Issues related to dependencies that are not in pyodide and cannot be installed with micropip tag: pyodide Related to issues with pyodide type: support neither a bug nor feature, is really just a user having questions or difficulty somewhere

Comments

@taranis2025
Copy link

Checklist

  • I added a descriptive title
  • I searched for other issues and couldn't find a solution or duplication
  • I already searched in Google and didn't find any good information or help

What happened?

Las redes neuronales (NN) no funcionan en pyscript. Sabemos que es una versión alfa, pero ¿qué se puede hacer por este fallo?. La plataforma no reconoce ninguna librería relativa al desarrollo de NN.

What browsers are you seeing the problem on? (if applicable)

Chrome

Console info

No response

Additional Context

No response

@taranis2025 taranis2025 added needs-triage Issue needs triage type: bug Something isn't working labels May 28, 2022
@nmstoker
Copy link
Contributor

Not a particularly well put issue, but i see it's your first 🙂

This isn't a bug as such, it's a limitation. I suppose you could research the underlying causes and try to help progress with those. There are some relevent details here:

pyodide/pyodide#1625

@nmstoker
Copy link
Contributor

FYI, there's further discussion here too:
pyodide/pyodide#1911

@marimeireles
Copy link
Member

Thanks for the replies @nmstoker.
Several packages don't work on pyscript because we depend on micropip to install them, or ultimately we're depending on pyodide support. There's a guide on how to build packages to pyodide but Pytorch is a different beast.
We're working on different solutions for this problem =)

@marimeireles marimeireles added tag: pyodide Related to issues with pyodide and removed type: bug Something isn't working needs-triage Issue needs triage labels May 30, 2022
@yannickfunk
Copy link
Contributor

If you still want NNs to be working, try sklearn! It works with pyscript and supports MLPs (Fully Connected neural Networks):
https://scikit-learn.org/stable/modules/generated/sklearn.neural_network.MLPClassifier.html?highlight=mlp#sklearn.neural_network.MLPClassifier

@taranis2025
Copy link
Author

Thank you all for responding. I'm not an expert in web applications, but I'd really appreciate any help on embedding neural networks using pyscript. It would be a great advance for those of us who regularly work with data science and predictive modeling.

@nmstoker
Copy link
Contributor

nmstoker commented Jun 1, 2022

@taranis2025 How constrained are you with regards to the NN you want to work with? Do you have pre-existing models or do you particularly want to use a certain framework or are you happy to build new NN in whatever's available?

If you're in the last category then as Yannick says you could try sklearn.

With the links i posted above, i found another repo that seems to be suitable: it only relies on numpy (which does run). It aims to reimplement the Keras API solely in numpy. As the saying goes "Your mileage may vary" but it might be worth a quick look:

https://github.com/ArtificialIntelligenceToolkit/aitk.keras

@naschimhit
Copy link

naschimhit commented Jun 12, 2022

Sympy package/module also doesn't work in pyscript

@nmstoker
Copy link
Contributor

Sympy so doesn't function in pyscript

@naschimhit - please could you clarify your point? Looks like you may have a typo.

@nmstoker
Copy link
Contributor

Thanks @naschimhit . I believe it should work, since it's available in Pyodide as you'll see here

Based on Stack Overflow questions/answers like this one, it looks like it does indeed work (but may need some work arounds for printing latex output):

https://stackoverflow.com/questions/72318609/pretty-print-sympy-when-not-using-ipython

Might be worth raising a separate issue if you've got further concerns (unless they all closely relate to the topic of this issue)

@alunacob
Copy link

Hey there,

Is there any easy way to allow building pyscript with a custom version of pyodide?

Even if some packages (e.g. shapely) are already available in pyodide, the pyodideversion used in pyscript does not contain them.

@alunacob
Copy link

Hey there,

Is there any easy way to allow building pyscript with a custom version of pyodide?

Even if some packages (e.g. shapely) are already available in pyodide, the pyodideversion used in pyscript does not contain them.

Nevermind, I did this by updating the pyodide version in /src/components/pyconfig.ts

@m00dy
Copy link

m00dy commented Jun 18, 2022

pyodide_webgpu.mp4

Join my army

@madhur-tandon madhur-tandon added the type: support neither a bug nor feature, is really just a user having questions or difficulty somewhere label Jun 26, 2022
@naschimhit
Copy link

terima kasih@naschimhit. Saya percaya itu akan berhasil, karena tersedia di Pyodide seperti yang akan Anda lihat di sini

Berdasarkan pertanyaan/jawaban Stack Overflow seperti ini, sepertinya memang berfungsi (tetapi mungkin perlu beberapa perbaikan untuk mencetak keluaran lateks):

https://stackoverflow.com/questions/72318609/pretty-print-sympy-when-not-using-ipython

Mungkin layak untuk mengangkat masalah terpisah jika Anda memiliki masalah lebih lanjut (kecuali semuanya terkait erat dengan topik masalah ini)

I have a conclusion for this, in my opinion should using mathjax. Is it like that?

@marimeireles
Copy link
Member

I'm not sure if we should close this as a no-fix... because it's probably really low in our priority list to make NN libs work with pyscript. Thoughts here @tedpatrick?
Thanks!

@marimeireles marimeireles added the waiting on feedback Issue or PR waiting on feedback from core team label Oct 4, 2022
@marimeireles
Copy link
Member

I'm closing it as it's not a specific request for a package.
Feel free to open a discussion under the packages page for requesting support for NN libs.
Cheers.

@marimeireles marimeireles added package Issues related to dependencies that are not in pyodide and cannot be installed with micropip and removed waiting on feedback Issue or PR waiting on feedback from core team labels Feb 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package Issues related to dependencies that are not in pyodide and cannot be installed with micropip tag: pyodide Related to issues with pyodide type: support neither a bug nor feature, is really just a user having questions or difficulty somewhere
Projects
Archived in project
Development

No branches or pull requests

8 participants