-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
宋翔
authored and
宋翔
committed
Sep 27, 2017
1 parent
bacb424
commit da9a3f4
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
||
|