Skip to content

Commit

Permalink
Add mxnet pack operation
Browse files Browse the repository at this point in the history
  • Loading branch information
宋翔 authored and 宋翔 committed Sep 27, 2017
1 parent bacb424 commit da9a3f4
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions uaitrain/operation/pack_docker_image/mxnet_pack_op.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 2017 The UAI-SDK Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================

from uaitrain.operation.pack_docker_image.base_pack_op import BaseUAITrainDockerImagePackOp

class MXNetUAITrainDockerImagePackOp(BaseUAITrainDockerImagePackOp):
"""docstring for ClassName"""
def __init__(self, parser):
super(MXNetUAITrainDockerImagePackOp, self).__init__(parser)
self.ai_arch = "caffe"

def _parse_args(self, args):
super(MXNetUAITrainDockerImagePackOp, self)._parse_args(args)

def _add_args(self):
super(MXNetUAITrainDockerImagePackOp, self)._add_args()

def _gen_gpu_docker_cmd(self, pycmd):
gpu_docker_cmd = "sudo nvidia-docker run -it " + \
"-v " + self.test_data_path + ":" + "/data/data " + \
"-v " + self.test_output_path + ":" + "/data/output " + \
self.user_gpu_image + " " + "/bin/bash -c " + \
"\"cd /data && /usr/bin/python " + pycmd + " " + "--num_gpus=1 --work_dir=/data --data_dir=/data/data --output_dir=/data/output --log_dir=/data/output\""
return gpu_docker_cmd



0 comments on commit da9a3f4

Please sign in to comment.