Coder Social home page Coder Social logo

ossas_chatbot's Introduction

cover

目录

OSSAS ChatBot

​ 嗨,这是一个基于Keras搭建的单轮中文聊天机器人!

​ 这是我学习机器学习两个月的结果,所以或多或少会有不足。

​ 模型采用Encoder-Decoder结构,Encoder采用BiLSTM,Decoder采用LSTM。并且加入了Attention机制。这是它的模型图(使用Netron生成):

s2s

使用方法

可能需要安装的依赖:

​ 在运行前需要安装:VC++

​ 地址:https://support.microsoft.com/zh-cn/help/2977003/the-latest-supported-visual-c-downloads

机器人下载地址:

GitHub release

百度云 提取码:6zq6

​ 软件在Windows10测试可用。

​ 在下载后,你可以看到两个程序:Ossas.exeQQRecord2Excel.exe

Ossas.exe是实现聊天机器人的主程序,它包括了以下功能:

​ 1)数据预处理和模型构建

​ 2)模型训练

​ 3)开启与Cool_Q的接口(以此来实现使用QQ进行人机对话)

​ 4)实时对话(训练完成后你可以在这里和机器人进行直接对话)

​ 而QQRecord2Excel.exe的功能是帮助你将QQ导出原始数据,转化为一条条 问——答 形式的可训练数据。当然你也可以将想要训练的数据一条条手动编辑,这种情况下你不需要用到QQRecord2Excel.

配置文件介绍

​ 请注意,配置文件不能够被删除并且应以正确的格式进行配置。

​ 配置文件存储在workspace文件夹中,而workspace中的train_data文件夹存储着你的模型信息,你不需要担心train_data中的内容。

ext_dict.txt :这是进行分词的额外字典。当你输入的训练数据有生僻词的时候,生僻词可能不会被识别。在这个文件添加词语可以辅助程序进行分词,详情参看 https://github.com/fxsjy/jieba [主要功能>载入词典] 部分。

train_config.txt :这个文件目前只储存了一个参数,predict_maxlen.这个参数限制机器人对话时,输出句子的最长长度。编辑格式遵循json。

coolq_config.txt :这个参数配置和Cool_Q对接的参数。编辑格式遵循json。

split.txt :这个参数用于QQRecord2Excel.exe,用于识别不同人发出的消息。编辑格式遵循json。

QQRecord2Excel

基本功能

​ 如果你想纯手动编辑训练数据,可以跳过这一步。

​ QQ导出的聊天记录是这样子的:

2018-10-04 11:13:36  你
天啊Dimsmary太强了8

2018-10-04 11:13:37  成员A(000000000)
确实

2018-10-04 11:13:46  你
怎么说

2018-10-04 11:26:20  成员B(111111111)
我觉得可以

​ 程序通过时间戳这一行的后九位字符进行识别发言人。

2018-10-04 11:13:37  成员A(000000000)

​ 如上所示,成员A的标识为:00000000)

​ 我们在split.txt 中添加聊天记录中的发言人(注意不要漏了右括号)。

{
	"成员A": "00000000)",
	"成员B": "11111111)",
	"else":"你自己的名字"
}

​ 将你导出的聊天记录重命名为record.txt并放在workspace文件夹内,然后启动QQRecord2Excel.exe进入模式1,程序将会把你的record.txt转化为record.xlsx

#f03c15 因为程序按照(时间戳行-发言行-空行)这样一种格式循环读取,所以每位发言人的发言只能为一行,超过一行的发言请手动删减。并且第一行应为时间戳行。

0 1 label
你自己的名字 天啊Dimsmary太强了8 0
成员A 确实 0
你自己的名字 怎么说 0
成员B 我觉得可以 0

通过依次标记1、2来确定问答,标记为0的数据将被略过。

需要注意:1、2的标记必须依次进行,不能连续出现两个1。

​ 同一个1可以对应多个2,但我不确定这样的训练数据是否会更好。

0 1 label
你自己的名字 天啊Dimsmary太强了8 1
成员A 确实 2
你自己的名字 怎么说 1
成员B 我觉得可以 2

标记完成后使用QQRecord2Excel.exe的模式2,去掉未标记的数据,输出sort_record.xlsx

最后使用模式3,将sort_record.xlsx转化为训练数据:train.xlsx

至此训练数据的预处理完成。

拓展功能

在0.0.2alpha的更新中,为了更好处理不同的数据,添加了以下两个模式:

1)将TAB分隔的数据转换为OSSAS可读的数据

在此模式下,软件将会读取workspace下的tab_split.txt并转换为tab_split.xlsx

tab_split.txt的文本应看起来是这样:

你今天吃了吗?	我吃了
...

原始数据:

你今天吃了吗?\t我吃了\n
...

2)将带标签的TAB分隔的数据转换为OSSSAS可读的数据

在此模式下,软件将会读取workspace下的sign_tab_split.txt并转换为sign_tab_split.xlsx

tab_split.txt的文本应看起来是这样:

0	你今天吃了吗?	我吃了
...

原始数据:

0\t你今天吃了吗?\t我吃了\n
...

需要注意,对于多轮对话将会去重。即不会有多个相同问题。

OSSAS

在启动程序前,训练数据train.xlsx应当被准备好。

它看起来是这样的:

input output
天啊Dimsmary太强了8 确实
怎么说 我觉得可以

每一行对应一个问答。

确认训练数据无误后,我们可以开始训练我们的模型。

运行OSSAS.exe

输入1,进行数据的预处理和模型的初始化。

输入2,开始模型训练。

在开始模型训练的时候,这里要求你输入两个参数:循环轮数batch size

循环轮数:模型训练的次数。

batch size:模型更新参数的样本间隔;大的batch size将训练更快,但也许更大的batch size并不会更好。

在训练过程中你可以看到两个参数:

Epoch 1/10
2/2 [==============================] - 4s 2s/sample - loss: 1.3541 - accuracy: 0.022

lossaccuracy,loss代表模型计算结果和实际结果的误差,accuracy代表模型计算结果和实际结果的贴合度。loss越低、accuracy越高,模型对训练数据的拟合越好。

当完成训练后,你可以进入模式4和机器人对话来查看训练效果:

>你说:Dimsmary太强了
确实

如果对机器人不满意,可以进入模式2继续训练。

#f03c15注意,模型在生成完成后,不再依赖原始的训练数据 train.xlsx

#f03c15在对train.xlsx进行修改后,若想要应用修改,则需要重新生成模型(重新运行模式1)和重新训练。

CoolQ

如果想让机器人参与QQ群聊,我们需要用到CoolQ插件。

CoolQ下载地址:https://cqp.cc/

并且我们需要在CoolQ内安装CQHTTP。

CQHTTP下载地址:https://cqhttp.cc/

在安装完成后,我们需要分别对coolq和OSSAS进行配置。

我们首先对OSSAS进行配置,打开workspace中的coolq_config.txt:

{
"post_url":"http://127.0.0.1:5700/send_group_msg", 
"at_id":"[CQ:at,qq=YourQQ]",
"host_port": 7777
}

我们需要将"at_id":"[CQ:at,qq=YourQQ]", 中的的YourQQ更改为你的QQ号码,用来识别群聊是否被@

其他可以不作更改。

打开CQHTTP的配置目录:

酷Q的目录\data\app\io.github.richardchien.coolqhttpapi\config

打开配置文件(你的QQ号.txt):

修改post_url为:

"post_url": "http://127.0.0.1:7777",

配置完成后,启动启用CQHTTP,开启OSSAS.exe并进入模式3。

此时,在机器人已经加入的QQ群内@机器人 并附对话,机器人将作出回复。

保存模型

当你完成模型训练后,想要再创建一个模型又不丢失原有模型的话,你可以将train.xlsxworkspace文件夹进行进行备份。

错误反馈

如果出现运行突然终止的情况,请使用windows控制台运行程序,将错误代码提交至issue

代码介绍

软件使用Python开发,所需库在requirements.txt中。

main.py : OSSAS的主程序。

Seq2Seq.py : 执行模型各种操作的封装文件。

QQRecord2TXT.py: 进行聊天记录转换的程序。

程序简图

OSSAS_work_flow

更新记录

2020/04/06 更新 readme:

​ 修正了readme中的一些小问题

2020/04/05 更新Alpha0.0.3:

​ 修复了OSSAS分词文件丢失的致命问题

2020/04/03 更新Alpha0.0.2:

​ OSSAS:增加了BILSTM/LSTM的unit数量。

​ QQRecore2Excel: 新增了模式4和模式5

2020/03/27 Alpha0.0.1版本发布啦

ossas_chatbot's People

Contributors

dimsmary avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ossas_chatbot's Issues

batchSize > 1时,INVALID_ARGUMENT: required broadcastable shapes

batchsize测试下来只能设置1,不管是什么gpu,一旦设置大于1就会报错如下

-----------------
模式1:搭建模型
模式2:训练模型
模式3:开启Coolq接口
模式4:进行对话
-----------------
输入工作模式:2
输入循环轮数:2000
输入batch size:2
Tue May 10 09:35:46 2022 正在处理训练数据...
Tue May 10 09:35:46 2022 循环轮数:2000 batch size:2
2022-05-10 09:35:46.823820: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-05-10 09:35:46.833743: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-05-10 09:35:46.834556: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-05-10 09:35:46.835683: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2022-05-10 09:35:46.836013: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-05-10 09:35:46.836818: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-05-10 09:35:46.837657: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-05-10 09:35:47.446699: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-05-10 09:35:47.447592: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-05-10 09:35:47.448356: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-05-10 09:35:47.449143: W tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:39] Overriding allow_growth setting because the TF_FORCE_GPU_ALLOW_GROWTH environment variable is set. Original config value was 0.
2022-05-10 09:35:47.449235: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 10794 MB memory:  -> device: 0, name: Tesla K80, pci bus id: 0000:00:04.0, compute capability: 3.7
Epoch 1/2000
2022-05-10 09:36:03.719284: I tensorflow/stream_executor/cuda/cuda_dnn.cc:368] Loaded cuDNN version 8100
2022-05-10 09:36:04.314831: W tensorflow/core/framework/op_kernel.cc:1733] INVALID_ARGUMENT: required broadcastable shapes
Traceback (most recent call last):
  File "/content/drive/MyDrive/Ossas_ChatBot/main.py", line 113, in <module>
    rnn.train_model(bat, epo)
  File "/content/drive/MyDrive/Ossas_ChatBot/Seq2Seq.py", line 79, in train_model
    model.fit([encoder_input_data, decoder_input_data], decoder_target_data,
  File "/usr/local/lib/python3.9/site-packages/keras/utils/traceback_utils.py", line 67, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/usr/local/lib/python3.9/site-packages/tensorflow/python/eager/execute.py", line 54, in quick_execute
    tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
tensorflow.python.framework.errors_impl.InvalidArgumentError: Graph execution error:

Detected at node 'Equal' defined at (most recent call last):
    File "/content/drive/MyDrive/Ossas_ChatBot/main.py", line 113, in <module>
      rnn.train_model(bat, epo)
    File "/content/drive/MyDrive/Ossas_ChatBot/Seq2Seq.py", line 79, in train_model
      model.fit([encoder_input_data, decoder_input_data], decoder_target_data,
    File "/usr/local/lib/python3.9/site-packages/keras/utils/traceback_utils.py", line 64, in error_handler
      return fn(*args, **kwargs)
    File "/usr/local/lib/python3.9/site-packages/keras/engine/training.py", line 1384, in fit
      tmp_logs = self.train_function(iterator)
    File "/usr/local/lib/python3.9/site-packages/keras/engine/training.py", line 1021, in train_function
      return step_function(self, iterator)
    File "/usr/local/lib/python3.9/site-packages/keras/engine/training.py", line 1010, in step_function
      outputs = model.distribute_strategy.run(run_step, args=(data,))
    File "/usr/local/lib/python3.9/site-packages/keras/engine/training.py", line 1000, in run_step
      outputs = model.train_step(data)
    File "/usr/local/lib/python3.9/site-packages/keras/engine/training.py", line 864, in train_step
      return self.compute_metrics(x, y, y_pred, sample_weight)
    File "/usr/local/lib/python3.9/site-packages/keras/engine/training.py", line 957, in compute_metrics
      self.compiled_metrics.update_state(y, y_pred, sample_weight)
    File "/usr/local/lib/python3.9/site-packages/keras/engine/compile_utils.py", line 459, in update_state
      metric_obj.update_state(y_t, y_p, sample_weight=mask)
    File "/usr/local/lib/python3.9/site-packages/keras/utils/metrics_utils.py", line 70, in decorated
      update_op = update_state_fn(*args, **kwargs)
    File "/usr/local/lib/python3.9/site-packages/keras/metrics.py", line 178, in update_state_fn
      return ag_update_state(*args, **kwargs)
    File "/usr/local/lib/python3.9/site-packages/keras/metrics.py", line 729, in update_state
      matches = ag_fn(y_true, y_pred, **self._fn_kwargs)
    File "/usr/local/lib/python3.9/site-packages/keras/metrics.py", line 4043, in categorical_accuracy
      tf.equal(
Node: 'Equal'
Detected at node 'Equal' defined at (most recent call last):
    File "/content/drive/MyDrive/Ossas_ChatBot/main.py", line 113, in <module>
      rnn.train_model(bat, epo)
    File "/content/drive/MyDrive/Ossas_ChatBot/Seq2Seq.py", line 79, in train_model
      model.fit([encoder_input_data, decoder_input_data], decoder_target_data,
    File "/usr/local/lib/python3.9/site-packages/keras/utils/traceback_utils.py", line 64, in error_handler
      return fn(*args, **kwargs)
    File "/usr/local/lib/python3.9/site-packages/keras/engine/training.py", line 1384, in fit
      tmp_logs = self.train_function(iterator)
    File "/usr/local/lib/python3.9/site-packages/keras/engine/training.py", line 1021, in train_function
      return step_function(self, iterator)
    File "/usr/local/lib/python3.9/site-packages/keras/engine/training.py", line 1010, in step_function
      outputs = model.distribute_strategy.run(run_step, args=(data,))
    File "/usr/local/lib/python3.9/site-packages/keras/engine/training.py", line 1000, in run_step
      outputs = model.train_step(data)
    File "/usr/local/lib/python3.9/site-packages/keras/engine/training.py", line 864, in train_step
      return self.compute_metrics(x, y, y_pred, sample_weight)
    File "/usr/local/lib/python3.9/site-packages/keras/engine/training.py", line 957, in compute_metrics
      self.compiled_metrics.update_state(y, y_pred, sample_weight)
    File "/usr/local/lib/python3.9/site-packages/keras/engine/compile_utils.py", line 459, in update_state
      metric_obj.update_state(y_t, y_p, sample_weight=mask)
    File "/usr/local/lib/python3.9/site-packages/keras/utils/metrics_utils.py", line 70, in decorated
      update_op = update_state_fn(*args, **kwargs)
    File "/usr/local/lib/python3.9/site-packages/keras/metrics.py", line 178, in update_state_fn
      return ag_update_state(*args, **kwargs)
    File "/usr/local/lib/python3.9/site-packages/keras/metrics.py", line 729, in update_state
      matches = ag_fn(y_true, y_pred, **self._fn_kwargs)
    File "/usr/local/lib/python3.9/site-packages/keras/metrics.py", line 4043, in categorical_accuracy
      tf.equal(
Node: 'Equal'
2 root error(s) found.
  (0) INVALID_ARGUMENT:  required broadcastable shapes
	 [[{{node Equal}}]]
	 [[broadcast_weights_1/assert_broadcastable/AssertGuard/pivot_f/_15/_71]]
  (1) INVALID_ARGUMENT:  required broadcastable shapes
	 [[{{node Equal}}]]
0 successful operations.
0 derived errors ignored. [Op:__inference_train_function_21896]

尝试的时候遇到的一些问题

split.txt文件修改后,模式1得出的表格里面,第一列数据值全是else后面的内容,完全没有其他成员的名称,我的聊天内容只有两个人的对话,希望作者大大能出一个实际范本split.txt

KeyError: 'input'

c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py:489: MatplotlibDeprecationWarning:
The MATPLOTLIBDATA environment variable was deprecated in Matplotlib 3.1 and will be removed in 3.3.
2022-05-27 11:52:11.730438: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2022-05-27 11:52:11.730708: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

---OSSAS ChatBot-----
--人工智障聊天机器人---
---版本:0.0.3_alpha---

作者:Dimsmary
网址:dimsmary.tech

本软件完全免费
代码遵循MIT协议


模式1:搭建模型
模式2:训练模型
模式3:开启Coolq接口
模式4:进行对话

输入工作模式:1
Fri May 27 11:52:19 2022 读取训练数据...
Building prefix dict from the default dictionary ...
Loading model from cache C:\Users\qxc\AppData\Local\Temp\jieba.cache
Loading model cost 2.736 seconds.
Prefix dict has been built successfully.
Traceback (most recent call last):
File "site-packages\pandas\core\indexes\base.py", line 2897, in get_loc
File "pandas/_libs/index.pyx", line 107, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 131, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1607, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1614, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'input'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "main.py", line 108, in
File "Seq2Seq.py", line 284, in pre_precess
File "Seq2Seq.py", line 47, in load_data
File "site-packages\pandas\core\frame.py", line 2995, in getitem
File "site-packages\pandas\core\indexes\base.py", line 2899, in get_loc
File "pandas/_libs/index.pyx", line 107, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 131, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1607, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1614, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'input'
[19888] Failed to execute script main

[已退出进程,代码为 4294967295 (0xffffffff)]

使用Coolq接口时报错

由于coolq被封,所以我用的是node-onebot,不知道是不是node-onebot的问题

报错:

输入工作模式:3
Mon Jan 24 19:08:27 2022 开始监听Coolq/HTTP上报
{'self_id': 3495297353, 'time': 1643022537, 'post_type': 'message', 'message_type': 'group', 'sub_type': 'normal', 'message_id': 'OEEuQrCCrTcAAAEeS47XBGHuiMkB', 'group_id': 943795778, 'group_name': 'KucRobot官方群', 'user_id': 2961354039, 'anonymous': None, 'message': [{'type': 'at', 'data': {'qq': 3495297353, 'text': '@小楚妹妹'}}, {'type': 'text', 'data': {'text': ' 在?'}}], 'raw_message': '[CQ:at,qq=3495297353,text=@小楚妹妹] 在?', 'atme': True, 'block': False, 'seqid': 286, 'font': '微软雅黑', 'sender': {'user_id': 2961354039, 'nickname': '裕依', 'card': '', 'sex': 'male', 'age': 14, 'area': '徐州', 'level': 1, 'role': 'owner', 'title': ''}}
Traceback (most recent call last):
File "main.py", line 117, in
File "main.py", line 48, in http_receive
AttributeError: 'list' object has no attribute 'find'
[17708] Failed to execute script main

一些建议和疑惑

首先是聊天记录的分类太繁琐了,希望能够增加:自动为“你”的消息标记标签2
并自动为“你”的消息前一条非“你”的消息标记1
这样想必能相更快地标记信息

其次是我使用cuda来训练模型时,每次都会跳出这样的提示,并且程序自动关闭。希望能解答一下是否出了什么差错
image
image
image

黑屏然后闪退

运行ossas.exe后黑屏,一段时间后显示以下文字:

c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py:489: MatplotlibDeprecationWarning:
The MATPLOTLIBDATA environment variable was deprecated in Matplotlib 3.1 and will be removed in 3.3.
Traceback (most recent call last):
File "tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
File "imp.py", line 296, in find_module
ImportError: No module named 'pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tensorflow\python\pywrap_tensorflow.py", line 58, in
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
File "tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
File "tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
ImportError: DLL load failed: 动态链接库(DLL)初始化例程失败。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 5, in
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
File "Seq2Seq.py", line 8, in
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
File "tensorflow_init
.py", line 40, in
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
File "tensorflow\python_init_.py", line 49, in
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
File "tensorflow\python\pywrap_tensorflow.py", line 74, in
ImportError: Traceback (most recent call last):
File "tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
File "imp.py", line 296, in find_module
ImportError: No module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tensorflow\python\pywrap_tensorflow.py", line 58, in
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
File "tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
File "tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
ImportError: DLL load failed: 动态链接库(DLL)初始化例程失败。
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
[11552] Failed to execute script main

运行main.py的反馈是:

Traceback (most recent call last):
File "F:\Ossas_ChatBox\Ossas_ChatBot-master\main.py", line 5, in
import Seq2Seq as rnn
File "F:\Ossas_ChatBox\Ossas_ChatBot-master\Seq2Seq.py", line 8, in
from tensorflow.keras.preprocessing.text import Tokenizer
ModuleNotFoundError: No module named 'tensorflow'

requirements.txt里的东西都装了

训练模型时报错: Incompatible shapes: [14] vs. [14,50]

环境:
Python 3.10.10
Tensorflow 2.12.0

日志:

Tue May 23 12:23:08 2023 正在处理训练数据...
Tue May 23 12:23:08 2023 循环轮数:5 batch size:20
Epoch 1/5
Traceback (most recent call last):
  File "C:\Users\Administrator\Desktop\NLP\OSSAS Chatbot\main.py", line 35, in <module>
    main()
  File "C:\Users\Administrator\Desktop\NLP\OSSAS Chatbot\main.py", line 22, in main
    seq.train_model(size, epoch)
  File "C:\Users\Administrator\Desktop\NLP\OSSAS Chatbot\seq2seq.py", line 79, in train_model
    model.fit([encoder_input_data, decoder_input_data], decoder_target_data,
  File "C:\Users\Administrator\Desktop\NLP\OSSAS Chatbot\venv\lib\site-packages\keras\utils\traceback_utils.py", line 70, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "C:\Users\Administrator\Desktop\NLP\OSSAS Chatbot\venv\lib\site-packages\tensorflow\python\eager\execute.py", line 52, in quick_execute
    tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
tensorflow.python.framework.errors_impl.InvalidArgumentError: Graph execution error:

Detected at node 'Equal' defined at (most recent call last):
    File "C:\Users\Administrator\Desktop\NLP\OSSAS Chatbot\main.py", line 35, in <module>
      main()
    File "C:\Users\Administrator\Desktop\NLP\OSSAS Chatbot\main.py", line 22, in main
      seq.train_model(size, epoch)
    File "C:\Users\Administrator\Desktop\NLP\OSSAS Chatbot\seq2seq.py", line 79, in train_model
      model.fit([encoder_input_data, decoder_input_data], decoder_target_data,
    File "C:\Users\Administrator\Desktop\NLP\OSSAS Chatbot\venv\lib\site-packages\keras\utils\traceback_utils.py", line 65, in error_handler
      return fn(*args, **kwargs)
    File "C:\Users\Administrator\Desktop\NLP\OSSAS Chatbot\venv\lib\site-packages\keras\engine\training.py", line 1685, in fit
      tmp_logs = self.train_function(iterator)
    File "C:\Users\Administrator\Desktop\NLP\OSSAS Chatbot\venv\lib\site-packages\keras\engine\training.py", line 1284, in train_function
      return step_function(self, iterator)
    File "C:\Users\Administrator\Desktop\NLP\OSSAS Chatbot\venv\lib\site-packages\keras\engine\training.py", line 1268, in step_function
      outputs = model.distribute_strategy.run(run_step, args=(data,))
    File "C:\Users\Administrator\Desktop\NLP\OSSAS Chatbot\venv\lib\site-packages\keras\engine\training.py", line 1249, in run_step
      outputs = model.train_step(data)
    File "C:\Users\Administrator\Desktop\NLP\OSSAS Chatbot\venv\lib\site-packages\keras\engine\training.py", line 1055, in train_step
      return self.compute_metrics(x, y, y_pred, sample_weight)
    File "C:\Users\Administrator\Desktop\NLP\OSSAS Chatbot\venv\lib\site-packages\keras\engine\training.py", line 1149, in compute_metrics
      self.compiled_metrics.update_state(y, y_pred, sample_weight)
    File "C:\Users\Administrator\Desktop\NLP\OSSAS Chatbot\venv\lib\site-packages\keras\engine\compile_utils.py", line 605, in update_state
      metric_obj.update_state(y_t, y_p, sample_weight=mask)
    File "C:\Users\Administrator\Desktop\NLP\OSSAS Chatbot\venv\lib\site-packages\keras\utils\metrics_utils.py", line 77, in decorated
      update_op = update_state_fn(*args, **kwargs)
    File "C:\Users\Administrator\Desktop\NLP\OSSAS Chatbot\venv\lib\site-packages\keras\metrics\base_metric.py", line 140, in update_state_fn
      return ag_update_state(*args, **kwargs)
    File "C:\Users\Administrator\Desktop\NLP\OSSAS Chatbot\venv\lib\site-packages\keras\metrics\base_metric.py", line 691, in update_state
      matches = ag_fn(y_true, y_pred, **self._fn_kwargs)
    File "C:\Users\Administrator\Desktop\NLP\OSSAS Chatbot\venv\lib\site-packages\keras\metrics\accuracy_metrics.py", line 426, in categorical_accuracy
      return metrics_utils.sparse_categorical_matches(
    File "C:\Users\Administrator\Desktop\NLP\OSSAS Chatbot\venv\lib\site-packages\keras\utils\metrics_utils.py", line 971, in sparse_categorical_matches
      matches = tf.cast(tf.equal(y_true, y_pred), backend.floatx())
Node: 'Equal'
Incompatible shapes: [14] vs. [14,50]
         [[{{node Equal}}]] [Op:__inference_train_function_19230]

(venv) C:\Users\Administrator\Desktop\NLP\OSSAS Chatbot>

MacOS下搭建模型的问题

Python版本:3.8.2
MacOS下clone项目代码编译运行。

Sat Apr 11 15:32:39 2020 读取训练数据...
Building prefix dict from the default dictionary ...
Loading model from cache /var/folders/rf/smxg24sn2pd7945k1wjwrzf00000gn/T/jieba.cache
Loading model cost 1.216 seconds.
Prefix dict has been built successfully.
Traceback (most recent call last):
  File "/Users/xxx/Documents/GitHub/Ossas_ChatBot/main.py", line 108, in <module>
    rnn.pre_precess()
  File "/Users/xxx/Documents/GitHub/Ossas_ChatBot/Seq2Seq.py", line 288, in pre_precess
    with open(dict_path, 'w') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/xxx/Documents/GitHub/Ossas_ChatBot/workspace/train_data/words_dictionary.txt'

在搭建模型时,报错为无法找到words_dictionary.txt

Error import TensorFlow 1.5.0 (import tensorflow as tf)

I managed to install TensorFlow 1.5.0 but when importing (import tensorflow as tf) the error ModuleNotFoundError: No module name 'tensorflow' what can be use windows 7 64 am doing this because my video card and processor are old sem suporte avx.

I followed the steps of this youtube tutorial https://www.youtube.com/watch?v=uIm3DMprk7M

I imagine that this would solve the error in the face extraction of DeepfaceLab?
Error do DeepFaceLab : Failed to load the native TensorFlow rutime.

缓存问题

请问训练所用的数据是放在默认C盘上吗,当我跑完数据之后C盘差不多就满了

闪退

前几次打开ossas都正常,加入了新的聊天记录后一打开什么都不显示就闪退

搞笑的不正常

2020-10-06 02:00:58.328401: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2020-10-06 02:00:58.335393: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

---OSSAS ChatBot-----
--人工智障聊天机器人---
---版本:0.0.3_alpha---

作者:Dimsmary
网址:dimsmary.tech

本软件完全免费
代码遵循MIT协议


模式1:搭建模型
模式2:训练模型
模式3:开启Coolq接口
模式4:进行对话

输入工作模式:4
输入数字0 退出
你说:你是谁
Building prefix dict from the default dictionary ...
Loading model from cache C:\Users\fff10\AppData\Local\Temp\jieba.cache
Loading model cost 0.921 seconds.
Prefix dict has been built successfully.
2020-10-06 02:01:24.501241: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'nvcuda.dll'; dlerror: nvcuda.dll not found
2020-10-06 02:01:24.507969: W tensorflow/stream_executor/cuda/cuda_driver.cc:312] failed call to cuInit: UNKNOWN ERROR (303)
2020-10-06 02:01:24.524965: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: DESKTOP-H607UJ3
2020-10-06 02:01:24.534686: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: DESKTOP-H607UJ3
2020-10-06 02:01:24.541614: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations: AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2020-10-06 02:01:24.596434: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x1dfb58ab6f0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-10-06 02:01:24.604586: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
????说?说?说?说?说?说?说?说
你说:我是谁
????说?说?说?说?说?说?说?说
你说:你
????说?说说?说?说?说?说?说?
你说:怎么说
???说?说?说?说?说?说?说?说?
你说:

QQRecord2Excel对非群聊(私聊)记录进行处理时发生异常

私聊数据进行1,2步骤时没有遇到问题,但是在进行第3步时候遇到了如下异常。
Empty DataFrame
Columns: []
Index: []
Traceback (most recent call last):
File "QQRecord2Excel.py", line 151, in
File "site-packages\pandas\core\generic.py", line 5192, in setattr
File "pandas/_libs/properties.pyx", line 67, in pandas._libs.properties.AxisProperty.set
File "site-packages\pandas\core\generic.py", line 690, in _set_axis
File "site-packages\pandas\core\internals\managers.py", line 183, in set_axis
ValueError: Length mismatch: Expected axis has 0 elements, new values have 2 elements
[35760] Failed to execute script QQRecord2Excel
注:我不太清楚该如何对split.txt进行编辑,这对于处理聊天记录而言是必要的吗

闪退

E:\迅雷下载\ai>OSSAS.exe c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py:489: MatplotlibDeprecationWarning: The MATPLOTLIBDATA environment variable was deprecated in Matplotlib 3.1 and will be removed in 3.3. 2021-02-19 21:43:53.830720: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found 2021-02-19 21:43:53.832902: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. ------------------------ ---OSSAS ChatBot----- --人工智障聊天机器人--- ---版本:0.0.3_alpha--- ------------------------- 作者:Dimsmary 网址:dimsmary.tech ----------------- 本软件完全免费 代码遵循MIT协议 ----------------- ----------------- 模式1:搭建模型 模式2:训练模型 模式3:开启Coolq接口 模式4:进行对话 ----------------- 输入工作模式:1 Fri Feb 19 21:44:01 2021 读取训练数据... Building prefix dict from the default dictionary ... Loading model from cache C:\Users\HDS\AppData\Local\Temp\jieba.cache Loading model cost 0.514 seconds. Prefix dict has been built successfully. Traceback (most recent call last): File "main.py", line 108, in File "Seq2Seq.py", line 284, in pre_precess File "Seq2Seq.py", line 46, in load_data File "site-packages\pandas\util_decorators.py", line 208, in wrapper File "site-packages\pandas\io\excel_base.py", line 310, in read_excel File "site-packages\pandas\io\excel_base.py", line 819, in init File "site-packages\pandas\io\excel_xlrd.py", line 21, in init File "site-packages\pandas\io\excel_base.py", line 359, in init File "site-packages\pandas\io\excel_xlrd.py", line 36, in load_workbook File "site-packages\xlrd_init_.py", line 111, in open_workbook FileNotFoundError: [Errno 2] No such file or directory: 'E:\迅雷下载\ai\workspace\train.xlsx' [5508] Failed to execute script main

闪退,求大佬

c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py:489: MatplotlibDeprecationWarning:
The MATPLOTLIBDATA environment variable was deprecated in Matplotlib 3.1 and will be removed in 3.3.
Traceback (most recent call last):
File "QQRecord2Excel.py", line 95, in
File "json_init_.py", line 296, in load
File "json_init_.py", line 338, in loads
json.decoder.JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0)
[7632] Failed to execute script QQRecord2Excel

出现fail to load the native tensorflow runtime

我电脑上同时有32位python3.7和64位python3.6,只有后者安装了能够正常import的TensorFlow。但是ossas.exe貌似默认使用python3.7并抛出错误。如何解决?
’C:\Users\a>C:\Users\a\Desktop\chatbot\OSSAS.exe
c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py:489: Matp
lotlibDeprecationWarning:
The MATPLOTLIBDATA environment variable was deprecated in Matplotlib 3.1 and wil
l be removed in 3.3.
Traceback (most recent call last):
File "tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_impor
t_helper
File "imp.py", line 296, in find_module
ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "tensorflow\python\pywrap_tensorflow.py", line 58, in
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py",
line 489, in exec_module
File "tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
File "tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_impor
t_helper
ImportError: DLL load failed: 找不到指定的模块。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "main.py", line 5, in
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py",
line 489, in exec_module
File "Seq2Seq.py", line 8, in
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py",
line 489, in exec_module
File "tensorflow_init_.py", line 40, in
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py",
line 489, in exec_module
File "tensorflow\python_init_.py", line 49, in
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py",
line 489, in exec_module
File "tensorflow\python\pywrap_tensorflow.py", line 74, in
ImportError: Traceback (most recent call last):
File "tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_impor
t_helper
File "imp.py", line 296, in find_module
ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "tensorflow\python\pywrap_tensorflow.py", line 58, in
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py",
line 489, in exec_module
File "tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
File "tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_impor
t_helper
ImportError: DLL load failed: 找不到指定的模块。

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
[5916] Failed to execute script main

C:\Users\a>‘

关于QQ信息记录导入的修改

    # d_tail = label[-10: -1]

    tail_str = label.split(" ")[0]
    # for key_ in key_list:
    #     if d_tail == tail[key_]:
    #         tail_str = key_
    # if tail_str == '':
    #     tail_str = tail['else']
    # 创建名称——文本Series

由于现在复制出来的格式是这样的:
“”“
【好孩子2】昵称 2020/10/3 21:43:23
消息
”“”
所以我将第一个空格前的内容作为tail_str。不知道有没有用。

我尝试后有的一些疑问

训练后的问答是完全OK的。主要就是对话数据的导入问题。不确定是不是我的理解有问题。我的qq聊天记录导出后,在人名后面并没有()以及里面的成员标识00000000。想问作者这个是要我完全自己在.txt中逐条添加吗? 另外,对于产生的record.xlsx,我也要完全手动地修改label为1和2吗,或者您有什么好的方法。 (本人不是学python和机器学习的,只是从b站看到了介绍视频,故怀着兴趣下来玩的。如有什么问题提的不好还望包涵)

一个建议和一个兼容问题

请问您可以多做一个不是单exe的版本发出来吗?
这样大家就都可以使用里面的库文件放到.py版本的目录里面测试了。
感觉.exe文件的版本支持不是很好。我Win10x86的电脑不知道为什么刚点开exe就提示不兼容此电脑。

一些疑惑,希望能得到解答

1.闪退的问题,不知道是怎么回事下载的文件一直缺斤少两
详情:缺少标签文件"words_dictionary.txt"
2.CQHTTP,发送监听HTTP请求时报错,尝试自行修订,未果
详情:[HTTP] http上报地址 127.0.0.1:7777 无法访问

关于生僻词词典的一些困惑

问一下这个有什么用,虽然说是辅助程序但想问一下如果不向里面添加词和添加了词的区别以及对相同训练数据所训练出来的有什么影响

动态链接库(DLL)初始化例程失败

c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py:489: MatplotlibDeprecationWarning:
The MATPLOTLIBDATA environment variable was deprecated in Matplotlib 3.1 and will be removed in 3.3.
Traceback (most recent call last):
File "tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
File "imp.py", line 296, in find_module
ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "tensorflow\python\pywrap_tensorflow.py", line 58, in
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
File "tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
File "tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
ImportError: DLL load failed: 动态链接库(DLL)初始化例程失败。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "main.py", line 5, in
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
File "Seq2Seq.py", line 8, in
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
File "tensorflow_init_.py", line 40, in
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
File "tensorflow\python_init_.py", line 49, in
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
File "tensorflow\python\pywrap_tensorflow.py", line 74, in
ImportError: Traceback (most recent call last):
File "tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
File "imp.py", line 296, in find_module
ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "tensorflow\python\pywrap_tensorflow.py", line 58, in
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
File "tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
File "tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
ImportError: DLL load failed: 动态链接库(DLL)初始化例程失败。

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
[14076] Failed to execute script main

[功能请求]QQRecord2Excel处理数据时增加出错行数通知

我是自行编辑训练数据的(找沙雕群友当苦力
希望能增加一个提示表格处理出错行数的功能。

使用模式2转换record.xlsx到soft_record.xlsx时报错。
问题似乎是因为表格一些地方不符合要求,截取前数十条数据时可以正常处理。
我这边一共有7w+条数据,因为是打算群里自己玩的所以未做去敏,恕无法提供原始数据供以复现问题。

附错误输出
Traceback (most recent call last): File "QQRecord2Excel.py", line 127, in <module> File "site-packages\pandas\core\ops\__init__.py", line 1229, in wrapper File "site-packages\pandas\core\ops\__init__.py", line 1091, in na_op File "site-packages\pandas\core\ops\__init__.py", line 1069, in _comp_method_OBJECT_ARRAY File "pandas/_libs/ops.pyx", line 96, in pandas._libs.ops.scalar_compare TypeError: '>' not supported between instances of 'str' and 'int' [14636] Failed to execute script QQRecord2Excel

OSSAS.exe闪退

错误如下

c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py:489: MatplotlibDeprecationWarning:
The MATPLOTLIBDATA environment variable was deprecated in Matplotlib 3.1 and will be removed in 3.3.
Traceback (most recent call last):
  File "tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
  File "imp.py", line 296, in find_module
ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
  File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
  File "tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
  File "tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
ImportError: DLL load failed: 找不到指定的模块。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 5, in <module>
  File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
  File "Seq2Seq.py", line 8, in <module>
  File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
  File "tensorflow\__init__.py", line 40, in <module>
  File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
  File "tensorflow\python\__init__.py", line 49, in <module>
  File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
  File "tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
ImportError: Traceback (most recent call last):
  File "tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
  File "imp.py", line 296, in find_module
ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
  File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
  File "tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
  File "tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
ImportError: DLL load failed: 找不到指定的模块。


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.
[8432] Failed to execute script main

我之前还试着安装过requirement.txt,但是还是会打开OSSAS.exe之后黑一段时间然后突然报错加闪退,QQRecord2Excel.exe倒可以运行。
顺便请问一下这个程序是只要是win电脑就能打开还是说也得安装相应插件和lib,感谢

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.