Notice: 请使用python3.11来运行此项目
-
安装poetry
pip install poetry==1.8.5
-
使用poetry安装依赖
poetry install
-
启动项目
poetry run python main.py
-
安装poetry
pip install poetry==1.8.5
-
使用poetry安装依赖
poetry install
-
在Kaggle下载数据集 (数据集很大,可以把每个分类降至100张图片再来训练)
-
如果只训练数字 0-9 ,修改 train.py 第17行代码
self.BackBone.fc = nn.Linear(self.BackBone.fc.in_features, 10)
-
将数据集放在 train/train_images ,然后开始训练
python train.py
-
训练完成后,修改 require/network.py 第10行代码
self.BackBone.fc = nn.Linear(self.BackBone.fc.in_features, 10)
-
将训练好的模型拷贝至 require/ 文件夹内,并重命名为 model.pth (训练好的模型在**train/checkpoints/**文件夹)
-
修改 require/dictionary.txt
0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9
-
启动项目
poetry run python main.py

