Views
No views yet

| 0% of margin | 20% of margin | 50% of margin | loss | epoch |
|---|---|---|---|---|
| 0.9012 | 0.7998 | 0.5700 | 0.4674 | 10 |
1 model_dict = torch.load('./checkpoint.pth')['state_dict']
2 model_dict_mod = {}
3 for key, value in model_dict.items():
4 new_key = '.'.join(key.split('.')[1:])
5 model_dict_mod[new_key] = value
6 self.model.load_state_dict(model_dict_mod)prepare_data.py 生成数据集,将汉字转换为图片,默认黑体字体,也可以用别的,从C://Windows/Fonts Windows系统上下载character文件表示训练数据,同一个子文件夹表示其中的汉字是相似的,不同的子文件夹表示汉字不相似train.py为训练文件