提交 61e5698f 编写于 作者: Y yejianwu

fix caffe validate for exited container

上级 78dabbed
......@@ -643,6 +643,11 @@ def validate_model(abi,
sh.docker("build", "-t", image_name, "docker/caffe")
container_id = sh.docker("ps", "-qa", "-f", "name=%s" % container_name)
if container_id and not sh.docker("ps", "-qa", "--filter",
"status=running", "-f",
"name=%s" % container_name):
sh.docker("rm", "-f", container_name)
container_id = ""
if not container_id:
print("Run caffe container")
sh.docker(
......@@ -654,14 +659,6 @@ def validate_model(abi,
image_name,
"/bin/bash")
container_status = sh.docker("inspect",
"-f",
"{{.State.Running}}",
container_name)
if container_status == "false":
print("Start caffe container")
sh.docker("start", container_name)
for input_name in input_nodes:
formatted_input_name = formatted_file_name(
input_name, input_file_name)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册