Labeled-LDA-Python icon indicating copy to clipboard operation
Labeled-LDA-Python copied to clipboard

An error occured when I use the function load_model_from_dir

Open JeromePau opened this issue 5 years ago • 1 comments

Thank you very much for sharing your code. When I download your example.py and run it, I found an error occured when I use '''llda_model_new.load_model_from_dir(save_model_dir, load_derivative_properties=False)'''.

And here is the traceback: ''' Traceback (most recent call last):

File "", line 1, in runfile('D:/putong/taxiLDA/Labeled-LDA-Python-master/example/example.py', wdir='D:/putong/taxiLDA/Labeled-LDA-Python-master/example')

File "D:\ana\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile execfile(filename, namespace)

File "D:\ana\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "D:/putong/taxiLDA/Labeled-LDA-Python-master/example/example.py", line 78, in llda_model_new.load_model_from_dir(save_model_dir, load_derivative_properties=False)

File "..\model\labeled_lda.py", line 794, in load_model_from_dir self._initialize_derivative_fields()

File "..\model\labeled_lda.py", line 126, in _initialize_derivative_fields self.alpha_vector_Lambda = self.alpha_vector * self.Lambda

ValueError: operands could not be broadcast together with shapes (0,) (6,6) ''' I think something goes wrong when the program loads and reads the model.

JeromePau avatar Jul 29 '20 13:07 JeromePau

Sorry, I am busy these days

I have read your question, I think the problem is your model has not been written completely, or something wrong when writing the model to disk Are you sure your model in the disk is ok? please use my original code run 'python example.py' again, and tell me if there is any problem

JoeZJH avatar Aug 05 '20 02:08 JoeZJH