From e2a18ea1c3ddee766eddf6c6a6abd871d442cc52 Mon Sep 17 00:00:00 2001 From: gengdongjie Date: Mon, 16 Aug 2021 16:54:11 +0800 Subject: [PATCH] fix issues on modelzoo --- model_zoo/research/cv/DnCNN/src/data_generator.py | 2 +- model_zoo/research/cv/mnasnet/scripts/run_distribute_train.sh | 3 ++- model_zoo/research/nlp/senta/script/eval.sh | 2 +- model_zoo/research/nlp/senta/script/run_infer_310.sh | 4 ++-- model_zoo/research/nlp/senta/script/train.sh | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/model_zoo/research/cv/DnCNN/src/data_generator.py b/model_zoo/research/cv/DnCNN/src/data_generator.py index 4bc14e645e..411778ae51 100644 --- a/model_zoo/research/cv/DnCNN/src/data_generator.py +++ b/model_zoo/research/cv/DnCNN/src/data_generator.py @@ -115,7 +115,7 @@ class DenoisingDataset: batch_x = self.xs[index, ...] noise = np.random.standard_normal(size=batch_x.shape) * (self.sigma/255.0) batch_y = batch_x + noise - return batch_y, noise + return batch_y.astype(np.float32), noise.astype(np.float32) def __len__(self): return len(self.xs) diff --git a/model_zoo/research/cv/mnasnet/scripts/run_distribute_train.sh b/model_zoo/research/cv/mnasnet/scripts/run_distribute_train.sh index 338e713907..9f8303dd33 100644 --- a/model_zoo/research/cv/mnasnet/scripts/run_distribute_train.sh +++ b/model_zoo/research/cv/mnasnet/scripts/run_distribute_train.sh @@ -21,6 +21,7 @@ ulimit -u unlimited export DEVICE_NUM=8 export RANK_SIZE=8 export RANK_TABLE_FILE=$PATH1 +export HCCL_CONNECT_TIMEOUT=1200 for ((i = 0; i < ${DEVICE_NUM}; i++)); do let deviceID=$i @@ -37,4 +38,4 @@ for ((i = 0; i < ${DEVICE_NUM}; i++)); do env >env.log python -u train.py --run_distribute=True --dataset_path=$PATH2 > log.txt 2>&1 & cd .. -done \ No newline at end of file +done diff --git a/model_zoo/research/nlp/senta/script/eval.sh b/model_zoo/research/nlp/senta/script/eval.sh index 1cc4a8294e..fd6b2d5edc 100644 --- a/model_zoo/research/nlp/senta/script/eval.sh +++ b/model_zoo/research/nlp/senta/script/eval.sh @@ -14,4 +14,4 @@ # limitations under the License. # ============================================================================ -python eval.py --data_url ./data/ --ckpt ./SST-2.ckpt \ No newline at end of file +python eval.py --data_url ./data/ --ckpt ./SST-2.ckpt &> eval.log & diff --git a/model_zoo/research/nlp/senta/script/run_infer_310.sh b/model_zoo/research/nlp/senta/script/run_infer_310.sh index df811a2dcc..cfe7bbc4f8 100644 --- a/model_zoo/research/nlp/senta/script/run_infer_310.sh +++ b/model_zoo/research/nlp/senta/script/run_infer_310.sh @@ -95,7 +95,7 @@ function infer() function cal_acc() { - python3.7 ../postprocess.py --result_dir=./result_files --label_dir=./preprocess_result/03_data &> acc.log + python3.7 ../postprocess.py --result_dir=./result_files --label_dir=./preprocess_result/03_data &> acc.log & } if [ $need_preprocess == "y" ]; then @@ -119,4 +119,4 @@ cal_acc if [ $? -ne 0 ]; then echo "calculate accuracy failed" exit 1 -fi \ No newline at end of file +fi diff --git a/model_zoo/research/nlp/senta/script/train.sh b/model_zoo/research/nlp/senta/script/train.sh index 89c68eb269..476c1fa823 100644 --- a/model_zoo/research/nlp/senta/script/train.sh +++ b/model_zoo/research/nlp/senta/script/train.sh @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================ -python train.py --data_url ./data/ --train_url ./output/ \ No newline at end of file +python train.py --data_url ./data/ --train_url ./output/ &> train.log &