Problem installing and loading BERTopic on colab
See original GitHub issueHi
I trained my models using an HPC server and then I want to explore the trained models. I realised that if a model is trained with GPU, it must be loaded using GPU powered machines (except I can load it and save it as cpu alternative, but that’s the next thing i will try).
I then tried to do this on google colab, I share a colab book here: https://colab.research.google.com/drive/1jCVH4Yy_nE2Y-teyZeNZ8TGWoINp0Xzw?usp=sharing
But I had no luck in installing BERTopic, and then loading the model.
In the part that install other libraries (flair, use, etc), I got some errors that like this
Attempting uninstall: sentence-transformers
Found existing installation: sentence-transformers 2.2.0
Uninstalling sentence-transformers-2.2.0:
Successfully uninstalled sentence-transformers-2.2.0
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
torchtext 0.11.0 requires torch==1.10.0, but you have torch 1.7.0 which is incompatible.
torchaudio 0.10.0+cu111 requires torch==1.10.0, but you have torch 1.7.0 which is incompatible.
markdown 3.3.6 requires importlib-metadata>=4.4; python_version < "3.10", but you have importlib-metadata 3.10.1 which is incompatible.
google-colab 1.0.0 requires requests~=2.23.0, but you have requests 2.27.1 which is incompatible.
datascience 0.10.6 requires folium==0.2.1, but you have folium 0.8.3 which is incompatible.
Successfully installed bpemb-0.3.3 dataclasses-0.6 deprecated-1.2.13 flair-0.7 ftfy-6.1.1 importlib-metadata-3.10.1 janome-0.4.1 konoha-4.6.5 langdetect-1.0.9 mpld3-0.3 overrides-3.1.0 requests-2.27.1 segtok-1.5.11 sentence-transformers-1.2.1 sentencepiece-0.1.91 sqlitedict-1.7.0 tokenizers-0.9.3 torch-1.7.0 torchvision-0.8.1 transformers-3.5.1
WARNING: The following packages were previously imported in this runtime:
[dataclasses]
You must restart the runtime in order to use newly installed versions.
Then in the code that loads the model, this line topic_model=BERTopic.load(model_folder+"/"+model_file)
causes this error:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
[<ipython-input-1-d0cfacde8768>](https://localhost:8080/#) in <module>()
7
8 #load a trained topic model
----> 9 topic_model=BERTopic.load(model_folder+"/"+model_file)
10
11 #get basic topic info
5 frames
[/usr/local/lib/python3.7/dist-packages/numba/core/serialize.py](https://localhost:8080/#) in _unpickle__CustomPickled(serialized)
206 Uses `NumbaPickler` to load.
207 """
--> 208 ctor, states = loads(serialized)
209 return _CustomPickled(ctor, states)
210
ModuleNotFoundError: No module named 'numba.cloudpickle'
Any suggestions would be highly appreciated, thanks!
Issue Analytics
- State:
- Created 2 years ago
- Comments:8
Hi all, I am having this issue in a docker container when trying to load the model.
First thing I did was:
but doesn’t seem to work. How did you solve it?
I have the same problem when attempting to load a model. The model in question was created months ago, so I’m wondering if it has to do with a colab/python/package config at the time which has changed and the model is no longer loadable. I’m going to start from scratch.