-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Error when using tfjs-node with Angular #753
Comments
At what step do you see this error? If you see this while trying to save the model, could you also add the code you are using to save it? |
I get it as I do I didn't get to saving the model because the error occurs before that |
Hmm, but may I ask, why do you need (Sorry, I might be making completely wrong assumptions. Just trying to understand your setup.) |
Why should saving the model on the client side be a bad idea? Imagine you have a mobile app that should work without a connection. Then it would be great to have the model saved locally so I can still make predictions. Also maybe I don't need a backend for my application and don't want to create one just for the reason to save my tf model. Thats my Idea. I'm a total beginner at machine learning and this might be a horrible idea for some reason but currently thats what I'm trying to do. |
Saving on client side is totally fine, but if that's what you're doing, then you don't need For more info, refer to this doc, particularly the methods marked with "Browser". |
Do you mean with saving to local storage? Imagine I have an App and I have an pre trained model. How could I ship this model with my app and load the model when starting this app? I would have to load it from a file, right? And this is only possible with the node module as far as I know. I appreciate the help btw! |
Assuming you want to deploy the app as a static site, one possible way to achieve this would be:
|
Thanks, thats an interesting way to do it. I will try it. But if it was possible to use node within my angular application it would still be easier. So is it just not possible? Why does not work like that? I thought angular uses node? |
Angular only uses Node.js to build and compile your files to JavaScript, and to run a dev server on your machine. However, inside the JavaScript code which is compiled and shipped to the browser, you cannot use Node.js because the context has changed from your machine to the browser, where direct access to the file system is just not available. |
Ok I get it. Thanks a lot for the help. I tried what you previously said. I have a
That works well. |
I am getting this: could it be related?
Its an error that doesn't fail the build. code here https://github.com/QuantumInformation/tensorflowjs-playground/tree/master/api-examples |
@quantuminformation There seems to be nothing wrong with your |
Yeah but it would kill CI and makes me sad.
On Wed, 13 Feb 2019 at 15:12, Darshak Parikh ***@***.***> wrote:
@quantuminformation <https://github.com/QuantumInformation> There seems
to be nothing wrong with your index.ts, so this error might very well be
harmless.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#753 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANN9s_aMmSKa_JcAR7ll7T47Kpc_gC5ks5vNCtkgaJpZM4XEuVo>
.
--
Kind regards
Nikos Katsikanis
|
This suggestion/workaround fixed it for me in Angular 7. https://stackoverflow.com/questions/54533766/tensorflow-with-angular-7-failed-to-compile/54571360 |
1 similar comment
This suggestion/workaround fixed it for me in Angular 7. https://stackoverflow.com/questions/54533766/tensorflow-with-angular-7-failed-to-compile/54571360 |
Can you add |
add browser/crypto = false in package.json
|
Sorry, I am late to the discussion. |
i had same problem, |
Describe the problem or feature request
I'm trying to save my model in a file with Angular 6. I expected it to work just like a normal Node.js project but I get these errors:
Code to reproduce the bug / link to feature request
This is my code:
The text was updated successfully, but these errors were encountered: