代码主页: https://github.com/bgshih/aster
1.建立工程目录
aster-code:
aster-master:
aster:
2.建立镜像
编写dockerfile
执行命令:
docker build -t aster-test:v2 .
docker run -i -t aster-test:v2 /bin/bash
3.进入目录:
cd/..../aster-code/aster/master
执行命令:
docker run -v /..../aster-code/aster-master:/aster-code/aster-master/ -w/aster-code/aster-master aster-test:v2 protoc ./aster/protos/*.proto --python_out=.
于是会在aster-master/aster/protos生成一系列python文件:
在/aster-code/aster-master/aster/c_ops目录下执行命令:
docker run -v /..../aster-code/aster-master/aster/c_ops:/aster-code/aster-master/aster/c_ops -w/aster-code/aster-master/aster/c_ops aster-test:v2 sh build.sh
执行demo文件:
docker run -v /...../aster-code/aster-master:/aster-code/aster-master/ -w/aster-code/aster-master/ aster-test:v2 python demo.py
则表示demo脚本运行成功!
Remark:本来运行该脚本会报错:
解决方案是一定要在环境中装tensorflow==1.4(一定要是这个版本!)
pip install tensorflow==1.4
最后测试的图片是: