神经网络训练过程中出现bug

神经网络训练过程中出现bug
print('[INFO] Inference time: {}'.format(inference))
    report = classification_report(y_test,
                                   predictions.argmax(axis=1),
                                   target_names=classNames)
    # save the classification report to file
    reportPath = os.path.join(result_path, "{}.txt".format(os.path.basename(model_path).split('.')[-2]))
    f = open(reportPath, "w")
    f.write(os.path.basename(model_path).split('.')[-2] + "\n")
    f.write(report + "\n")
    f.write("Duration : {}\n".format(Duration))
    f.write("Inference time : {}\n".format(inference))
    f.close()

程序能够跑通,也能出结果。但训练好像是被提前终止了。程序出现问题的部分应该是上述部分的代码。因为上述部门的代码没有实现。

img

好像是pyqt5的问题,是不是缺少什么学习库阿?

用多进程分离py和训练了吗?
大部分时候是由于业务量太大导致界面组件长时间得不到响应或刷新从而产生异常

是不是下面这个打印报告部分有问题啊? predictions.argmax(axis=1)?

report = classification_report(y_test,
                                   predictions.argmax(axis=1),
                                   target_names=classNames)

pyqt5动态链接库没找到,你可以检查下有没有配置pyqt环境变量

添加打印信息,做一个计数变量如count,每次循环加1,打印循环运行的次数。
根据你的程序打印,有很多次都是能够执行的,那么就需要确定出问题的那一次是第几次,是否是触发了什么条件,进入了之前没有进入的地方;还是由于反复调用,系统资源不足了。

参考一下

参考