zi2zi-chain:字体机器学习环境配置

环境安装

CUDA

python

这里我装的是python3.9,因为装python3.7的话cuda似乎没有对应版本。新建一个miniconda环境。

pytorch

查找和cuda相对应的版本号,例如Cuda 12.8

1
pip install --pre torch torchvision  --index-url https://download.pytorch.org/whl/nightly/cu128

1
2
3
python font2img.py --src_font=src.otf --dst_font=trg.otf --charset=CN --sample_count=1000 --sample_dir=dir --label=0 --filter --shuffle --mode=font2font
python package.py --dir=dir --save_dir=experiment/data --split_ratio=0.8
python train.py --experiment_dir=experiment --gpu_ids=cuda:0 --batch_size=32 --epoch=100 --sample_steps=200 --checkpoint_steps=500