diff --git a/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/Dockerfile b/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/Dockerfile index 6076e6fcde50a005f94e3d57f1c03ec2d7b448aa..0dd97d97fd08921d2ac594e511efce5c452e4b79 100644 --- a/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/Dockerfile +++ b/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/Dockerfile @@ -1,9 +1,7 @@ ARG FROM_IMAGE_NAME=ascend-tensorflow-arm:20.1.0 FROM ${FROM_IMAGE_NAME} - +USER root RUN apt -y install libgl1-mesa-glx COPY requirements.txt . RUN pip3.7 install -r requirements.txt - -RUN ln -s /usr/bin/python3.7 /usr/bin/python3 \ No newline at end of file diff --git a/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/docker_start.sh b/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/docker_start.sh index e99bbe7685ba6f302f694e54a5d15ebe0f1c6b08..949698ab8238841d4b1d1adef4cf6387b0642e2f 100644 --- a/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/docker_start.sh +++ b/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/docker_start.sh @@ -1,5 +1,19 @@ #!/bin/bash +#Copyright 2022 Huawei Technologies Co., Ltd + +#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. + docker_image=$1 data_dir=$2 model_dir=$3 diff --git a/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/infer/docker_start_infer.sh b/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/infer/docker_start_infer.sh index 72889067a499eb55e93cac635d4b00454799524a..69f4fbbf409fdef7a78bc6c3a6d484f93bdec952 100644 --- a/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/infer/docker_start_infer.sh +++ b/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/infer/docker_start_infer.sh @@ -38,7 +38,7 @@ function param_check() { param_check -docker run -it \ +docker run -it -u root \ --device=/dev/davinci0 \ --device=/dev/davinci_manager \ --device=/dev/devmm_svm \ diff --git a/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/modelarts/args_modelarts_multi.py b/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/modelarts/args_modelarts_multi.py index 2d7d2032f135a8f9330f61eeffd7f99ff50d093a..7ae30ea0cbadcb0115bad2844c437896d8996223 100644 --- a/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/modelarts/args_modelarts_multi.py +++ b/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/modelarts/args_modelarts_multi.py @@ -45,7 +45,7 @@ if not os.path.exists(save_dir): if not os.path.exists(log_dir): os.makedirs(log_dir) -work_path = '/cache/user-job-dir/YoloV3_for_TensorFlow' +work_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), "../") ### Some paths train_file = os.path.join(work_path, './modelarts/coco2014_trainval_modelarts.txt') # The path of the training txt file. diff --git a/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/modelarts/args_modelarts_single.py b/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/modelarts/args_modelarts_single.py index 3cf9c95680169187bfb77d8251d09177f4173576..7f5d4bd356c4835bdfaeda5be64088b23627a90f 100644 --- a/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/modelarts/args_modelarts_single.py +++ b/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/modelarts/args_modelarts_single.py @@ -45,7 +45,7 @@ if not os.path.exists(save_dir): if not os.path.exists(log_dir): os.makedirs(log_dir) -work_path = '/cache/user-job-dir/YoloV3_for_TensorFlow' +work_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), "../") ### Some paths train_file = os.path.join(work_path, './modelarts/coco2014_trainval_modelarts.txt') # The path of the training txt file. diff --git a/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/test/train_performance_1p.sh b/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/test/train_performance_1p.sh index 714d7a8b5ddbaa3291cebf414bbff110e202a79f..f53b38fd403fdb34ae12da25b8c37db90eca7f48 100644 --- a/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/test/train_performance_1p.sh +++ b/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/test/train_performance_1p.sh @@ -135,6 +135,7 @@ do --mode single \ --data_url $data_path/coco \ --train_url ${cur_path}/output/$ASCEND_DEVICE_ID/ckpt \ + --total_epoches 1 \ --over_dump ${over_dump} \ --over_dump_path ${over_dump_path} \ > ${cur_path}/output/${ASCEND_DEVICE_ID}/train_${ASCEND_DEVICE_ID}.log 2>&1 & diff --git a/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/train.py b/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/train.py index 9fdc9b34e8a921e006f19e303db69325e84fe114..2348373849d32bebe03a546faeb4c475cd495c5a 100644 --- a/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/train.py +++ b/TensorFlow/built-in/cv/detection/YoloV3_ID0076_for_TensorFlow/train.py @@ -71,7 +71,8 @@ parser.add_argument("--save_dir", default='./training/', help="path of ckpt.") parser.add_argument("--batch_size", type=int, default=16, help="batchsize.") - +parser.add_argument("--total_epoches", type=int, default=200, + help="epoches of train.") # modify for npu overflow start # enable overflow parser.add_argument("--over_dump", type=str, default="False", @@ -108,7 +109,8 @@ if args_input.save_dir: args.save_dir = args_input.save_dir if args_input.batch_size: args.batch_size = args_input.batch_size - +if args_input.total_epoches: + args.total_epoches = args_input.total_epoches print('setting train mode %s.' % args_input.mode) # setting loggers