KittenCN / stock_prediction

基于神经网络的通用股票预测模型 A general stock prediction model based on neural networks
https://www.coderfan.com
GNU General Public License v3.0
178 stars 50 forks source link

Tcl_AsyncDelete: async handler deleted by the wrong thread #27

Closed mingxing0769 closed 1 year ago

mingxing0769 commented 1 year ago

data_queue, e:6, bn:0, loss:2.02e-03: Tcl_AsyncDelete: async handler deleted by the wrong thread | 3009/146149 [00:25<16:45, 142.33it/s]

训练个几轮后就会突然提示这个并自动退出

python 3.8 3.10 都一样出现这个问题

查得网上的方法,先测试一下试试:

predict.py里的:

import matplotlib.pyplot as plt 改为: import matplotlib matplotlib.use('Agg') from matplotlib import pyplot as plt

common.py里也先这样改:

import re import target import mplfinance as mpf import matplotlib matplotlib.use('Agg') from matplotlib import pyplot as plt import matplotlib as mpl# 用于设置曲线参数

import matplotlib.pyplot as plt

import torch.nn.functional as F from cycler import cycler# 用于定制线条颜色 from prefetch_generator import BackgroundGenerator from init import * from datetime import datetime, timedelta from torchvision.models import resnet101

先测试一下看看。

mingxing0769 commented 1 year ago

已经OK