https://github.com/tomasstankovic/mgr-tensorflow
Tensorflow API server
https://github.com/tomasstankovic/mgr-tensorflow
Last synced: 10 months ago
JSON representation
Tensorflow API server
- Host: GitHub
- URL: https://github.com/tomasstankovic/mgr-tensorflow
- Owner: tomasstankovic
- Created: 2017-03-31T18:27:42.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-24T21:00:47.000Z (over 8 years ago)
- Last Synced: 2025-01-13T15:49:09.350Z (11 months ago)
- Language: Python
- Size: 75.8 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mgr-tensorflow
Tensorflow python API
## Development
```
export FLASK_APP=flaskapp.py
export FLASK_DEBUG=1
flask run
```
## Deployment
### 1. Login to server
```
ssh -i cert/LeafProjectNew.pem ubuntu@ec2-35-157-132-97.eu-central-1.compute.amazonaws.com
```
### 2. Update & restart server
ON SERVER:
```
./update.sh
```
or
```
cd flaskapp/
git pull origin master
sudo apachectl restart
```
## Server installing
http://www.datasciencebytes.com/bytes/2015/02/24/running-a-flask-app-on-aws-ec2/
```
cd flaskapp/
git pull origin master
sudo pip install -r requirements.txt
sudo apachectl restart
```
Test tensorflow version
```
python -c 'import tensorflow as tf; print(tf.__version__)'
```
## Server logs (linux)
#### ERROR_LOGS
```
tail -f /var/log/apache2/error.log
```
#### APP_LOGS
```
tail -f /var/log/apache2/access.log
```
## API Methods
#### Server
http://ec2-35-157-132-97.eu-central-1.compute.amazonaws.com/
#### [GET, POST] /api/photo-prediction
http://ec2-35-157-132-97.eu-central-1.compute.amazonaws.com/api/photo-prediction
#### [GET, POST] /api/photo-prediction-mock-<1/2/3>
Return results with 1x > 80% data.
http://ec2-35-157-132-97.eu-central-1.compute.amazonaws.com/api/photo-prediction-mock-1
Return results with 2x > 80% data.
http://ec2-35-157-132-97.eu-central-1.compute.amazonaws.com/api/photo-prediction-mock-2
Return results with 0x > 80% data.
http://ec2-35-157-132-97.eu-central-1.compute.amazonaws.com/api/photo-prediction-mock-3