I am having an issue using Universal Sentence Encoder(USE) Multilingual inside a flask app. I am using it with TF2. When I initialize the flask app and load the USE model using hub.load() and then call it on text to get the embeddings, it works perfectly fine. But when I use that same object inside a request, it does not work. I see no errors coming and after some time the flask app sends a connection error. ConnectionError: ('Connection aborted.', …
I am in need of solving the below given requirement. Requirement: I have two datasets which has only one column called Name. That column contains a list of user names in both the datasets so from this dataset the requirement is when a user inputs a name from data 1 similar names from data 2 needs to be shown with their similarity score (Name matching score). So we need to solve this requirement and build an api using flask framework. …
I've trained a Tensorflow object detection model and want to deploy it with Flask. My problem is that with every new request the memory used by docker container rises by ~100mb, which is not freed after successful execution. So after few requests my container is OOM. Below is the fragment of my flask app code. detection_model = model_builder.build(model_config=configs['model'], is_training=False) ckpt = tf.compat.v2.train.Checkpoint(model=detection_model) ckpt.restore(os.path.join('model', 'ckpt-3')).expect_partial() @tf.function def detect_fn(image): image, shapes = detection_model.preprocess(image) prediction_dict = detection_model.predict(image, shapes) detections = detection_model.postprocess(prediction_dict, shapes) return …