mlchain-python icon indicating copy to clipboard operation
mlchain-python copied to clipboard

TensorFlow 1 Session hanging when run with pure python but not with CLI

Open lamhoangtung opened this issue 5 years ago • 0 comments

One internal project of Techainer discover a bug that when using python3 server.py with a content like this:

from mlchain.base import ServeModel
from model import Model
from mlchain import mlconfig

# mlconfig.load_config('mlconfig.yaml')
model = Model(weight_path=mlconfig.weight,
                     debug=mlconfig.debug)
model = ServeModel(model)

if __name__ == "__main__":
    from mlchain.rpc.server.flask_server import FlaskServer
    FlaskServer(model).run(bind=['127.0.0.1:8004'], gunicorn=True)

Have cause the self.sess.run inside the model class to hang forever. While using mlchain run CLI doesn't.

Noted that this model use Tensorflow 1.14, 1.15 suffer the same problem

This DOES NOT effect production usage since we only use mlchain run but this bug is worth more examination.

lamhoangtung avatar Nov 02 '20 07:11 lamhoangtung