potterhsu / SVHNClassifier

A TensorFlow implementation of Multi-digit Number Recognition from Street View Imagery using Deep Convolutional Neural Networks (http://arxiv.org/pdf/1312.6082.pdf)
GNU General Public License v3.0
206 stars 74 forks source link

How to make a web server ? #3

Closed tangshi closed 7 years ago

tangshi commented 7 years ago

I have successfully run this project and fine tuning with my custom data, thanks @potterhsu very much!

However, I don't know how to make it a web server to provide an interface which receives an image as input parameter and return the recognized result.

I wrote a function based on inference.py. I modified little, just changed it from a script to a function.

Unfortunately, the script (inference.py) runs well while the function based on it crashes, following is the error mesage:

F tensorflow/stream_executor/cuda/cuda_driver.cc: current context was not created by the StreamExecutor cuda_driver API: 0x36dc170; a CUDA runtime call was likely performed without using a StreamExecutor context [1] 30570 abort (core dumped) python host.py

I'm a newcomer in TensorFlow, can you help me ? Thank you very much !

potterhsu commented 7 years ago

You'd better ask in StackOverflow with exact code. If you are going to use in production environment, maybe you could give TensorFlow Serving a try.

tangshi commented 7 years ago

Thanks @potterhsu , it finally works. I just run the inference step in a new thread.