Blog post explaining it all Run Tensorflow scripts from Node.js server deployed on AWS as Docker container
Character generator using recurrent neural network (RNN). Also Node.js server used to provide HTTP API for training RNN and then generating samples from saved checkpoints.
Forked from hzy46/Char-RNN-TensorFlow
and is in separate directory (generator/
) now to avoid confusion. It has its own documentation
in generator/README.md
.
Trivial Node.js server used to store incoming training data and call python
scripts to train
and generate text. Read about it in server/README.md
Both server
and generator
are expected to run in Docker
and running image locally would replicate production environment.
You could also run server directly but then need to be sure that all
python dependencies are installed locally.
- To
build
container image:docker build -t <some_name> .
- To
run
above image:
docker run --rm -ti \
-e "MYSQL_HOST=docker.for.mac.localhost" \
-e "MYSQL_USER=root" \
-e "MYSQL_PASSWORD=" \
-e "MYSQL_DATABASE=rnn_generator" \
-p 8080:8080 <some_name>
New virtualenv
- Create new environment in dir
venv
-$ virtualenv -p python3 venv
- Activate environment -
$ source venv/bin/activate
- Install dependencies -
(venv) $ pip install -r requirements.txt
Existing virtualenv
- Activate environment -
$ source venv/bin/activate
- Use Node.js
v10
(venv) $ nvm use 10
run
server(venv) $ node server/server
You are free to open issues if there is anything bothering you, I'll read through and will make best effort to fix/reply ASAP.