Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问一下,这个lda无法出主题可视化效果怎么解决啊 #33

Open
zzl688vc opened this issue Oct 15, 2024 · 3 comments
Open

Comments

@zzl688vc
Copy link

主题模型序号数 0 主题数目 4 困惑度 -24.959 主题一致性 0.5314
主题模型序号数 1 主题数目 5 困惑度 -30.1313 主题一致性 0.6177
主题模型序号数 2 主题数目 6 困惑度 -35.7658 主题一致性 0.6523
主题模型序号数 3 主题数目 7 困惑度 -40.5825 主题一致性 0.6614
主题模型序号数 4 主题数目 8 困惑度 -45.336 主题一致性 0.6734
主题模型序号数 5 主题数目 9 困惑度 -48.2261 主题一致性 0.6965
主题模型序号数 6 主题数目 10 困惑度 -50.2806 主题一致性 0.716
主题模型序号数 7 主题数目 11 困惑度 -52.5358 主题一致性 0.7243
主题模型序号数 8 主题数目 12 困惑度 -54.3342 主题一致性 0.7261
主题模型序号数 9 主题数目 13 困惑度 -56.6513 主题一致性 0.7435
主题模型序号数 10 主题数目 14 困惑度 -58.3576 主题一致性 0.7311
主题模型序号数 11 主题数目 15 困惑度 -59.9731 主题一致性 0.7071
输入指定模型序号,以0为第一个: 0
Dominant_Topic ... Perc_Documents
1.0 0.0 ... 0.2439
2.0 1.0 ... 0.2683
0.0 2.0 ... 0.2398
3.0 3.0 ... 0.2480

[4 rows x 4 columns]
Traceback (most recent call last):
File "", line 1, in
File "D:\python37\lib\site-packages\joblib\externals\loky\backend\popen_loky_win32.py", line 153, in main
_winapi.SYNCHRONIZE | _winapi.PROCESS_DUP_HANDLE, False, parent_pid
AttributeError: module '_winapi' has no attribute 'SYNCHRONIZE'
Traceback (most recent call last):
File "", line 1, in
File "D:\python37\lib\site-packages\joblib\externals\loky\backend\popen_loky_win32.py", line 153, in main
_winapi.SYNCHRONIZE | _winapi.PROCESS_DUP_HANDLE, False, parent_pid
AttributeError: module '_winapi' has no attribute 'SYNCHRONIZE'
Traceback (most recent call last):
File "", line 1, in
File "D:\python37\lib\site-packages\joblib\externals\loky\backend\popen_loky_win32.py", line 153, in main
_winapi.SYNCHRONIZE | _winapi.PROCESS_DUP_HANDLE, False, parent_pid
AttributeError: module '_winapi' has no attribute 'SYNCHRONIZE'
Traceback (most recent call last):
File "", line 1, in
File "D:\python37\lib\site-packages\joblib\externals\loky\backend\popen_loky_win32.py", line 153, in main
_winapi.SYNCHRONIZE | _winapi.PROCESS_DUP_HANDLE, False, parent_pid
AttributeError: module '_winapi' has no attribute 'SYNCHRONIZE'
Traceback (most recent call last):
File "", line 1, in
File "D:\python37\lib\site-packages\joblib\externals\loky\backend\popen_loky_win32.py", line 153, in main
_winapi.SYNCHRONIZE | _winapi.PROCESS_DUP_HANDLE, False, parent_pid
AttributeError: module '_winapi' has no attribute 'SYNCHRONIZE'
Traceback (most recent call last):
File "", line 1, in
File "D:\python37\lib\site-packages\joblib\externals\loky\backend\popen_loky_win32.py", line 153, in main
_winapi.SYNCHRONIZE | _winapi.PROCESS_DUP_HANDLE, False, parent_pid
AttributeError: module '_winapi' has no attribute 'SYNCHRONIZE'
Traceback (most recent call last):
File "", line 1, in
Traceback (most recent call last):
File "", line 1, in
File "D:\python37\lib\site-packages\joblib\externals\loky\backend\popen_loky_win32.py", line 153, in main
File "D:\python37\lib\site-packages\joblib\externals\loky\backend\popen_loky_win32.py", line 153, in main
_winapi.SYNCHRONIZE | _winapi.PROCESS_DUP_HANDLE, False, parent_pid
AttributeError: module '_winapi' has no attribute 'SYNCHRONIZE'
_winapi.SYNCHRONIZE | _winapi.PROCESS_DUP_HANDLE, False, parent_pid
AttributeError: module '_winapi' has no attribute 'SYNCHRONIZE'
Traceback (most recent call last):
File "", line 1, in
File "D:\python37\lib\site-packages\joblib\externals\loky\backend\popen_loky_win32.py", line 153, in main
_winapi.SYNCHRONIZE | _winapi.PROCESS_DUP_HANDLE, False, parent_pid
AttributeError: module '_winapi' has no attribute 'SYNCHRONIZE'
Traceback (most recent call last):
File "", line 1, in
File "D:\python37\lib\site-packages\joblib\externals\loky\backend\popen_loky_win32.py", line 153, in main
_winapi.SYNCHRONIZE | _winapi.PROCESS_DUP_HANDLE, False, parent_pid
AttributeError: module '_winapi' has no attribute 'SYNCHRONIZE'
Traceback (most recent call last):
File "", line 1, in
File "D:\python37\lib\site-packages\joblib\externals\loky\backend\popen_loky_win32.py", line 153, in main
_winapi.SYNCHRONIZE | _winapi.PROCESS_DUP_HANDLE, False, parent_pid
AttributeError: module '_winapi' has no attribute 'SYNCHRONIZE'
Traceback (most recent call last):
File "", line 1, in
File "D:\python37\lib\site-packages\joblib\externals\loky\backend\popen_loky_win32.py", line 153, in main
_winapi.SYNCHRONIZE | _winapi.PROCESS_DUP_HANDLE, False, parent_pid
AttributeError: module '_winapi' has no attribute 'SYNCHRONIZE'
Traceback (most recent call last):
File "", line 1, in
Traceback (most recent call last):
File "", line 1, in
File "D:\python37\lib\site-packages\joblib\externals\loky\backend\popen_loky_win32.py", line 153, in main
_winapi.SYNCHRONIZE | _winapi.PROCESS_DUP_HANDLE, False, parent_pid
AttributeError: module '_winapi' has no attribute 'SYNCHRONIZE'
File "D:\python37\lib\site-packages\joblib\externals\loky\backend\popen_loky_win32.py", line 153, in main
_winapi.SYNCHRONIZE | _winapi.PROCESS_DUP_HANDLE, False, parent_pid
AttributeError: module '_winapi' has no attribute 'SYNCHRONIZE'
Traceback (most recent call last):
File "", line 1, in
Traceback (most recent call last):
File "", line 1, in
File "D:\python37\lib\site-packages\joblib\externals\loky\backend\popen_loky_win32.py", line 153, in main
File "D:\python37\lib\site-packages\joblib\externals\loky\backend\popen_loky_win32.py", line 153, in main
_winapi.SYNCHRONIZE | _winapi.PROCESS_DUP_HANDLE, False, parent_pid
AttributeError: module '_winapi' has no attribute 'SYNCHRONIZE'
_winapi.SYNCHRONIZE | _winapi.PROCESS_DUP_HANDLE, False, parent_pid
AttributeError: module '_winapi' has no attribute 'SYNCHRONIZE'
����: �޷���ֹ PID 16520 (���� PID 12556 �ӽ���)�Ľ��̡�
ԭ��: û�д������ʵ�������С�
����: û���ҵ����� "10356"��
����: û���ҵ����� "10716"��
����: û���ҵ����� "12780"��
����: û���ҵ����� "18792"��
����: û���ҵ����� "324"��
����: û���ҵ����� "10072"��
����: û���ҵ����� "13296"��
����: û���ҵ����� "18900"��
����: û���ҵ����� "13424"��
����: û���ҵ����� "19940"��
����: û���ҵ����� "13916"��
����: û���ҵ����� "12848"��
����: û���ҵ����� "15432"��
����: û���ҵ����� "12368"��
����: û���ҵ����� "19700"��
Traceback (most recent call last):
File "C:\Users\zzl\PycharmProjects\pythonProject6\weibo-public-opinion-analysis-main\LDA\测试.py", line 184, in
vis_data = save_visual(optimal_model, corpus, id2word, '主题可视化\' + name) # 可视化
File "C:\Users\zzl\PycharmProjects\pythonProject6\weibo-public-opinion-analysis-main\LDA\LDA.py", line 108, in save_visual
d=pyLDAvis.gensim.prepare(lda, corpus, id2word)
File "D:\python37\lib\site-packages\pyLDAvis\gensim.py", line 124, in prepare
return vis_prepare(**opts)
File "D:\python37\lib\site-packages\pyLDAvis_prepare.py", line 442, in prepare
n_jobs, start_index)
File "D:\python37\lib\site-packages\pyLDAvis_prepare.py", line 279, in _topic_info
for ls in _job_chunks(lambda_seq, n_jobs)))
File "D:\python37\lib\site-packages\joblib\parallel.py", line 1952, in call
return output if self.return_generator else list(output)
File "D:\python37\lib\site-packages\joblib\parallel.py", line 1595, in _get_outputs
yield from self._retrieve()
File "D:\python37\lib\site-packages\joblib\parallel.py", line 1699, in _retrieve
self._raise_error_fast()
File "D:\python37\lib\site-packages\joblib\parallel.py", line 1734, in _raise_error_fast
error_job.get_result(self.timeout)
File "D:\python37\lib\site-packages\joblib\parallel.py", line 736, in get_result
return self._return_or_raise()
File "D:\python37\lib\site-packages\joblib\parallel.py", line 754, in _return_or_raise
raise self._result
joblib.externals.loky.process_executor.TerminatedWorkerError: A worker process managed by the executor was unexpectedly terminated. This could be caused by a segmentation fault while calling the function or by an excessive memory usage causing the Operating System to kill the worker.
这是选完主题后的代码,没有图出来,可视化
Uploading 屏幕截图 2024-10-15 222702.jpg…
文件夹也是空的。

@stay-leave
Copy link
Owner

看报错是CPU内存空间不够了

@zzl688vc
Copy link
Author

好的感谢

@zzl688vc
Copy link
Author

解决了,joblib.externals.loky.process_executor.TerminatedWorkerError,去网上查了一下是因为joblib包版本过高(我的joblib版本是1.3.2),降低一下版本就行了。
pip install joblib==1.2.0
然后终于运行成功了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants