Closed satrio-yudhoatmojo closed 1 year ago
I believe I have not seen this error before. However, did you make sure that the environment in which you saved the model has the same structure as the one in which you loaded the model? It is important the dependencies are kept the same throughout environments and changes might break the model.
You need to load the file as stream, the Folder object is the location where the file resides. Below code solves the issue for me:
import shutil
with Topic_Model_folder.get_download_stream("<filename>") as stream, open("<filename>,'wb') as f_local:
shutil.copyfileobj(stream,f_local)
cu_topic_model= BERTopic.load("cu_Topic_Model")
This solves the problem of loading it, but the process fails while predicting the new dataset, and it works if both fit and transform run on the same session. But it fails if you just do transform in a different session. I am using the same code env for both processes. Steps followed:
If you run all 4 steps in one session it works, but if you fit and Save with one session the the approximate_predict function fails while scoring with the below error:
[23:23:34] [INFO] [dku.utils] - [2022-10-25 23:23:33,065] [39/MainThread] [DEBUG] [filelock] Lock 140316465655712 released on /opt/dataiku/code-env/resources/sentence_transformers/sentence-transformers_all-MiniLM-L6-v2/modules.json.lock [23:23:34] [INFO] [dku.utils] - [2022-10-25 23:23:33,366] [39/MainThread] [INFO] [sentence_transformers.SentenceTransformer] Use pytorch device: cuda [23:23:39] [INFO] [dku.utils] - [2022-10-25 23:23:39,733] [1/MainThread] [ERROR] [root] Containerized process terminated by signal 117 [23:23:39] [INFO] [dku.utils] - [2022-10-25 23:23:39,734] [1/MainThread] [INFO] [root] Sending error.json to backend/JEK [23:23:39] [INFO] [dku.utils] - [2022-10-25 23:23:39,734] [1/MainThread] [DEBUG] [root] Verifying SSL calls with certificate /home/dataiku/rpc_server_cert.pem
Due to inactivity, I'll be closing this issue for now. Feel free to reach out if you want to continue this discussion or re-open the issue!
I ran fit and transform on a different machine that has high specification and save the model and I also reduced the topics and save the result.
But, when I try to load the saved models in my computer, I got this error:
But, when I load them in the machine that I did the fit and transform and the reduced topics, it works just fine.