I use LDAvis library to visualize my LDA topics. It works fine before, but it gets me this error when I download the saved model files from Sagemaker to the local computer. I don't know why does this happen? Does that relate to Sagemaker?
If I run from the local, and saved the model from local, and then run LDAviz library, it works fine.
KeyError Traceback (most recent call last) in ()
~\AppData\Local\Continuum\anaconda3\lib\site-packages\pyLDAvis\gensim.py in prepare(topic_model, corpus, dictionary, doc_topic_dist, **kwargs)
116 See pyLDAvis.prepare for **kwargs.
117 """
--> 118 opts = fp.merge(_extract_data(topic_model, corpus, dictionary, doc_topic_dist), kwargs)
119 return vis_prepare(**opts)
~\AppData\Local\Continuum\anaconda3\lib\site-packages\pyLDAvis\gensim.py in _extract_data(topic_model, corpus, dictionary, doc_topic_dists) 46 gamma = topic_model.inference(corpus) 47 else: ---> 48 gamma, _ = topic_model.inference(corpus) 49 doc_topic_dists = gamma / gamma.sum(axis=1)[:, None] 50 else:
~\AppData\Local\Continuum\anaconda3\lib\site-packages\gensim\models\ldamodel.py in inference(self, chunk, collect_sstats) 665 # phinorm is the normalizer. 666 # TODO treat zeros explicitly, instead of adding epsilon? --> 667 eps = DTYPE_TO_EPS[self.dtype] 668 phinorm = np.dot(expElogthetad, expElogbetad) + eps 669
KeyError: dtype('float32')