Install python server with tensorflow


Download and install anaconda

https://www.anaconda.com/download/

After installation, in command prompt

conda create --name tensorflow python=3.5
activate tensorflow
(tensorflow)C:>pip install --ignore-installed --upgrade tensorflow

For installing GPU version of tensorflow, refer http://clatfd.cn/a/226

To test tensorflow installed correctly, check the following python script in python

import tensorflow as tf
#check which version is actually working
print(tf.__version__)
#1.3.0
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

It should give no errors if you installed correctly.

install the following packages which are needed in the projects

pip install keras tifffile opencv-python pydicom tqdm imageio h5py flask matplotlib scikit-image pandas interpolation

If there is error like

DLL load failed: The specified module could not be found.

when import cv2 

pip install opencv-python==3.4.1.15

set up python server

C:\Users\Li\Anaconda3\envs\tf\Scripts\activate tensorflow
cd D:\tensorflow\LiChen\Server
d:
SET FLASK_APP=app5000.py
flask run --host=128.208.221.39 --port=5000
SET FLASK_APP=app5003.py
flask run --host=128.208.221.39 --port=5003
SET FLASK_APP=app5004.py
flask run --host=128.208.221.39 --port=5004

Test using curl command

curl -k -X POST -F fun=1 -F px=363 -F py=231 -F image=@PATHTOIMG\cascadeMRImage.bmp -o PATHTOXML\contour.xml "128.208.221.39:5000/upload"
Last Article Next article

Comment 评论



Share 分享

New Users 最新加入

  • hokurikustr

  • refrain

New comments 最新评论

test123: aasdas Details Apr 13 16:39
admin: Thanks! Details Apr 09 11:46
admin: Google map api Details Apr 09 11:46
lqj12: cooooooooool Details Apr 08 21:34
Yunhan Huang: 这个功能是如何实现的? Details Apr 08 13:23