基于tensorflow构建的Fashion-MNIST数据集训练DEMO
pip3 install -r requirements-mac.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
pip3 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
python3 train.py
训练完成后在saved_model
目录中产出模型
# 方式一:本地推理
python3 test.py
# 方式二:本地通过HTTP Server推理
# 1、启动HTTP Server推理服务
nohup python3 app.py > run.log 2>&1 &
# 2、发送请求进行推理(以下4种方式可参考)
# 发送base64图片编码推理(python版本)
python3 test_base64_request.py
# 发送base64图片编码推理(shell版本)
sh test_base64_request.sh
# 发送图片文件推理(python版本)
python3 test_file_request.py
# 发送图片文件推理(shell版本)
sh test_file_request.sh
# 执行构建
docker build -t jerry9916/fashion-mnist:tensorflow-2.6.0-cuda11.2 .
# 将镜像保存为文件
docker save -o fashion-mnist-tensorflow.tar jerry9916/fashion-mnist:tensorflow-2.6.0-cuda11.2