zi2zi-pytorch
zi2zi-pytorch copied to clipboard
Update font2img.py AttributeError: 'NoneType' object has no attribute 'tobytes'
针对运行font2img.py文件时,出现的AttributeError: 'NoneType' object has no attribute 'tobytes'问题,提供以下一种解决方案:
由于目标字体无法生成一些charset中的生僻字,导致img返回空值,所以调用tobytes()方法就会报错。解决方案是当图像为空值时,从charset中随机抽取其他字体来代替该生僻字,直到字体图像正常生成为止。
运行的模式为mode=font2font模式