0

Hi I am very interested in machine learning.

familiar with keras and tensorflow and know how to train model and save it.

I want to build node.js(loopback) web application that provides machine learning API.

I'm quite new to web application and don't know how to utilize python code in the node app.

To be specific, I'm trying to make deep style application like this site for practice purpose.

For codes that is open to public in github. most starred implementation is in torch and

I am currently looking (TF).


It has script work as "main.py" that consists of

1) loading pretrained VGG model(about 500Mb) to memory.

2) and using each framework's function, it create output photo inside folder

So I want to run this with GPU instance in AWS

problem is, I don't know how to call "main.py" inside javascript.


Q1 How did many machine learning based services achieved this??

did they implement their server in python like django to load trained model and inference from it?

But I want to integrate in node.js especially loopback. how can I achieve this in a most efficient and common way??


Q2 Is calling "main.py" efficient whenever there's request to server?

I mean, If the script is called everytime request is made, It loads 500Mb object to memory all the time and that's so inefficient.

and as far as I know AWS GPU instance can utilize 4 GPU at a time. I wonder how can I utilize all of it with most efficient and common way...


Thank you for reading!

I'm too frustrated with myself... I really want to know method deploy my model to server

and thank you in advance

1 Answer 1

2

You can communicate between NodeJS and e.g. Django with a REST interface. Deploy a Django server with the REST framework and call an url from NodeJS. This way, you can trigger the python code. You can also let the python code call your NodeJS with another REST interface on the javascript side if that is needed.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.