MahmoudWahdan / dialog-nlu

Tensorflow and Keras implementation of the state of the art researches in Dialog System NLU
Apache License 2.0
98 stars 40 forks source link

Prediction function for tflite model not working #36

Closed deathsurgeon1 closed 3 years ago

deathsurgeon1 commented 3 years ago

nlu_model = TransformerNLU.load(save_path, quantized=True, num_process=1) utterance = "add sabrina salerno to the grime instrumentals playlist" result = nlu_model.predict(utterance) print(result) for item in result['slots']: print(item['value'])

Loading quantized model in 1 processes Model Loaded, process id: 300

After loading the tflite model, it shows processing only and not giving the prediction for the utterance

MahmoudWahdan commented 3 years ago

Hi @deathsurgeon1 Please, refer to this example to predict from tflite model. Please, make sure that the first thing in your prediction script is to disable your GPU, because tflite models is not working on PC GPUs.

import os
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"

Try it and let me know.

deathsurgeon1 commented 3 years ago

Hi @deathsurgeon1 Please, refer to this example to predict from tflite model. Please, make sure that the first thing in your prediction script is to disable your GPU, because tflite models is not working on PC GPUs.

import os
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"

Try it and let me know.

still not working model loaded log is displayed but after that it keeps on processing without giving any output

MahmoudWahdan commented 3 years ago

@deathsurgeon1 I think this behavior, because still GPU is not disabled. So, please share your OS system details, GPU, CPU, Python version. If you are using colab, share the link. try to enforce using CPU from colab itself.

deathsurgeon1 commented 3 years ago

@deathsurgeon1 I think this behavior, because still GPU is not disabled. So, please share your OS system details, GPU, CPU, Python version. If you are using colab, share the link. try to enforce using CPU from colab itself.

this tflite model loading and prediction was working earlier on colab. Can u verify this once on your side??

MahmoudWahdan commented 3 years ago

Sure, I'll do it may be tonight or tomorrow and let you know, because I don't have access to my machine now :)

MahmoudWahdan commented 3 years ago

@deathsurgeon1 It's working on my machine. Nothing changed! If you want any help, please provide :

So, please share your OS system details, GPU, CPU, Python version. If you are using colab, share the link.

MahmoudWahdan commented 3 years ago

Closed due to: Can't reproduced and no other information provided