diff --git a/research/cv/dcgan/README.md b/research/cv/dcgan/README.md
index 81a1554ef698d5f1ff57618e2a559205abfdbae5..2d0aed5dc1a7167f2b2c3fea117917926005d870 100644
--- a/research/cv/dcgan/README.md
+++ b/research/cv/dcgan/README.md
@@ -72,11 +72,23 @@ Train DCGAN Dataset used: [Imagenet-1k](<http://www.image-net.org/index>)
          └─utils.cc                      # 310 inference utils file
       ├─build.sh                         # 310 inference build file
       └─CMakeLists.txt                   # 310 inference cmake file
+  ├─ gpu_infer
+      ├─inc
+         └─utils.h                       # gpu inference header file
+      ├─src
+         ├─main.cc                       # gpu inference main file
+         └─utils.cc                      # gpu inference utils file
+      ├─build.sh                         # gpu inference build file
+      └─CMakeLists.txt                   # gpu inference cmake file
   ├─scripts                              # shell script
-    ├─run_standalone_train.sh            # training in standalone mode(1pcs)
-    ├─run_distribute_train.sh            # training in parallel mode(8 pcs)
-    ├─run_eval.sh                        # evaluation
-    └─run_infer_310.sh                   # infer on 310
+    ├─run_standalone_train_ascend.sh     # training in standalone mode(1pc)
+    ├─run_standalone_train_gpu.sh        # training in standalone mode(1pc)
+    ├─run_distribute_train_ascend.sh     # training in parallel mode(8pcs)
+    ├─run_distribute_train_gpu.sh        # training in parallel mode(8pcs)
+    ├─run_eval_ascend.sh                 # evaluation on ascend
+    ├─run_eval_gpu.sh                    # evaluation on gpu
+    ├─run_infer_310.sh                   # infer on 310
+    └─run_infer_gpu.sh                   # infer on gpu
   ├─ src
     ├─dataset.py                         # dataset create
     ├─cell.py                            # network definition
@@ -87,10 +99,9 @@ Train DCGAN Dataset used: [Imagenet-1k](<http://www.image-net.org/index>)
  ├─ train.py                             # train dcgan
  ├─ eval.py                              # eval dcgan
  ├─ preprocess.py                        # preprocess on 310
- ├─ postprocess.py                       # postprocess on 310
- ├─ verifyBySklSvmNetD_20_all_310.py     # verify on 310
  ├─ export.py                            # export checkpoint file
- └─ export_310.py                        # export checkpoint file for 310
+ ├─ verify.py                            # verify on 310
+ └─ requirements.txt                     # requirements
 ```
 
 ## [Script Parameters](#contents)
@@ -98,11 +109,17 @@ Train DCGAN Dataset used: [Imagenet-1k](<http://www.image-net.org/index>)
 ### [Training Script Parameters](#contents)
 
 ```shell
-# distributed training
-Usage: bash run_train.sh [RANK_TABLE_FILE] [DATASET_PATH] [SAVE_PATH]
+# distributed training on ascend
+Usage: bash run_distribute_train_ascend.sh [RANK_TABLE_FILE] [DATA_URL] [TRAIN_URL]
 
-# standalone training
-Usage: bash run_standalone_train.sh [DATASET_PATH] [SAVE_PATH]
+# standalone training on ascend
+Usage: bash run_standalone_train_ascend.sh [DEVICE_ID] [DATA_URL] [TRAIN_URL]
+
+# distributed training on gpu
+Usage: bash run_distribute_train_gpu.sh [DEVICE_NUM] [CUDA_VISIBLE_DEVICES] [DATA_URL] [TRAIN_URL]
+
+# standalone training on gpu
+Usage: bash run_standalone_train_gpu.sh [DEVICE_ID] [DATA_URL] [TRAIN_URL]
 ```
 
 ### [Parameters Configuration](#contents)
@@ -135,6 +152,8 @@ dcgan_cifar10_cfg {
 }
 ```
 
+- In order to conveniently store the files of the inference process,  batch_size of cifar10 is set to 100
+
 ## [Training Process](#contents)
 
 - Set options in `config.py`, including learning rate, output filename and network hyperparameters. Click [here](https://www.mindspore.cn/tutorials/en/master/advanced/dataset.html) for more information about dataset.
@@ -145,7 +164,7 @@ dcgan_cifar10_cfg {
 
 ```bash
 # standalone training
-run_standalone_train.sh [DATASET_PATH] [SAVE_PATH]
+Usage: bash run_standalone_train_ascend.sh [DEVICE_ID] [DATA_URL] [TRAIN_URL]
 ```
 
 ### [Distributed Training](#content)
@@ -153,7 +172,7 @@ run_standalone_train.sh [DATASET_PATH] [SAVE_PATH]
 - Run `run_distribute_train.sh` for distributed training of DCGAN model.
 
 ```bash
-run_distribute.sh [RANK_TABLE_FILE] [DATASET_PATH] [SAVE_PATH]
+bash run_distribute_train_ascend.sh [RANK_TABLE_FILE] [DATA_URL] [TRAIN_URL]
 ```
 
 - Notes
@@ -177,20 +196,27 @@ Date time:  2021-04-13 13:57:28         epoch:  0 / 20         step:  250 / 1001
 
 ### [Evaluation](#content)
 
-- Run `run_eval.sh` for evaluation.
+- Run  the evaluation script.
 
 ```bash
-# infer
-bush run_eval.sh [IMG_URL] [CKPT_URL]
+# eval on ascend or gpu
+bush run_eval_ascend.sh [IMG_URL] [CKPT_URL] [DEVICE_ID]
+# bush run_eval_gpu.sh [IMG_URL] [CKPT_URL] [DEVICE_ID]
 ```
 
-- Implement inference at Ascend310 platform.
+- Implement inference at Ascend310 or GPU platform.
 
 ```bash
-# infer
-bash run_infer_310.sh [MINDIR_PATH] [DATASET_PATH] [DEVICE_ID]
+# infer on ascend or gpu
+bash run_infer_310.sh [MINDIR_PATH] [DATA_URL] [DEVICE_ID]
+# bash run_infer_gpu.sh [MINDIR_PATH] [DATA_URL] [DEVICE_ID]
 ```
 
+- Notes
+1. A major contribution of the dcgan paper is to verify the capability of unsupervised representation learning with CNN, so we reproduce it on run_infer_310.sh or run_infer_gpu.sh.
+2. The infer process requires environment variable to be set, such as LD_PRELOAD, PYTHONPATH, LD_LIBRARY_PATH in run_infer_gpu.sh.
+3. 2.If you have the problem of `undefined reference to google::FlagRegisterer`, please refer to the [issue](#https://gitee.com/mindspore/mindspore/issues/I3X1EA).
+
 ### [Evaluation result](#content)
 
 Evaluation result will be stored in the img_url path. Under this, you can find generator result in generate.png.
@@ -209,23 +235,23 @@ python export.py --ckpt_file [CKPT_PATH] --device_target [DEVICE_TARGET] --file_
 
 ### Evaluation Performance
 
-| Parameters                 | Ascend                                                      |
-| -------------------------- | ----------------------------------------------------------- |
-| Model Version              | V1                                                          |
-| Resource                   | Ascend 910; CPU 2.60GHz, 192cores; Memory, 755G             |
-| uploaded Date              | 16/04/2021 (month/day/year)                                 |
-| MindSpore Version          | 1.1.1                                                       |
-| Dataset                    | ImageNet2012                                                |
-| Training Parameters        | epoch=20,  batch_size = 128                                 |
-| Optimizer                  | Adam                                                         |
-| Loss Function              | BCELoss                                      |
-| Output                     | predict class                                               |
-| Accuracy                   | 310: 78.2%                                             |
-| Loss                       | 10.9852                                                     |
-| Speed                      | 1pc: 420 ms/step;  8pcs:  195 ms/step                          |
-| Total time                 | 1pc: 25.32 hours                                            |
-| Checkpoint for Fine tuning | 79.05M(.ckpt file)                                         |
-| Scripts                    | [dcgan script](https://gitee.com/mindspore/models/tree/master/research/cv/dcgan) |
+| Parameters                 | Ascend                                                       | GPU                                                          |
+| -------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
+| Model Version              | V1                                                           | V1                                                           |
+| Resource                   | Ascend 910; CPU 2.60GHz, 192cores; Memory, 755G              | RTX 3090; CPU 2.90GHz, 64cores; Memory, 256G                 |
+| uploaded Date              | 16/04/2021 (month/day/year)                                  | 06/05/2022 (month/day/year)                                  |
+| MindSpore Version          | 1.1.1                                                        | 1.6.1                                                        |
+| Dataset                    | ImageNet2012, cifar-10                                       | ImageNet2012, cifar-10                                       |
+| Training Parameters        | epoch=20,  batch_size = 128                                  | epoch=20,  batch_size = 128                                  |
+| Optimizer                  | Adam                                                         | Adam                                                         |
+| Loss Function              | BCELoss                                                      | BCELoss                                                      |
+| Output                     | predict class                                                | predict class                                                |
+| Accuracy                   | 310: 78.2%                                                   | 1pc: 77.8% ;  8pcs:  75.1%                                   |
+| Loss                       | 10.9852                                                      | 0.3325(Dloss); 4.6742(Gloss)                                 |
+| Speed                      | 1pc: 420 ms/step;  8pcs:  195 ms/step                        | 1pc: 104 ms/step;  8pcs:  178 ms/step                        |
+| Total time                 | 1pc: 25.32 hours                                             | 1pc: 5.79 hours;  8pcs:  1.24 hours                          |
+| Checkpoint for Fine tuning | 79.05M(.ckpt file)                                           | 69.67M(.ckpt file)                                           |
+| Scripts                    | [dcgan script](https://gitee.com/mindspore/models/tree/master/research/cv/dcgan) | [dcgan script](https://gitee.com/mindspore/models/tree/master/research/cv/dcgan) |
 
 # [Description of Random Situation](#contents)
 
diff --git a/research/cv/dcgan/eval.py b/research/cv/dcgan/eval.py
index d14d085aacebcf613f13897f7b767a49b7ecd95c..ba2e93a90f1285926f09246f0d8d9068166596c1 100644
--- a/research/cv/dcgan/eval.py
+++ b/research/cv/dcgan/eval.py
@@ -1,4 +1,4 @@
-# Copyright 2021 Huawei Technologies Co., Ltd
+# Copyright 2021-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.
@@ -64,12 +64,13 @@ def load_dcgan(ckpt_url):
 
 if __name__ == '__main__':
     parser = argparse.ArgumentParser(description='MindSpore dcgan training')
-    parser.add_argument('--device_id', type=int, default=0, help='device id of Ascend (Default: 0)')
+    parser.add_argument('--device_target', type=str, default='Ascend', help='Ascend or GPU')
+    parser.add_argument('--device_id', type=int, default=0, help='device id of Ascend or GPU (Default: 0)')
     parser.add_argument('--img_url', type=str, default=None, help='img save path')
     parser.add_argument('--ckpt_url', type=str, default=None, help='checkpoint load path')
     args = parser.parse_args()
 
-    context.set_context(mode=context.GRAPH_MODE, device_target="Ascend")
+    context.set_context(mode=context.GRAPH_MODE, device_target=args.device_target)
     context.set_context(device_id=args.device_id)
 
     fixed_noise = Tensor(np.random.normal(size=(16, cfg.latent_size, 1, 1)).astype("float32"))
diff --git a/research/cv/dcgan/export.py b/research/cv/dcgan/export.py
index 91145a80bd325ad1c10c39087373d9b9f16769fa..617ac0883523961988a30e1efb3d36db0273d90f 100644
--- a/research/cv/dcgan/export.py
+++ b/research/cv/dcgan/export.py
@@ -1,4 +1,4 @@
-# Copyright 2021 Huawei Technologies Co., Ltd
+# Copyright 2021-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.
@@ -115,14 +115,16 @@ parser.add_argument("--run_modelart", type=ast.literal_eval, default=False, help
 parser.add_argument('--device_target', type=str, default='Ascend', choices=('Ascend', 'GPU'),
                     help='device where the code will be implemented (default: Ascend)')
 parser.add_argument("--device_id", type=int, default=0, help="Device id")
-parser.add_argument("--batch_size", type=int, default=128, help="batch size")
+parser.add_argument("--batch_size", type=int, default=100, help="batch size")
 parser.add_argument("--ckpt_url", default=None, help="Checkpoint file url.")
 parser.add_argument("--ckpt_file", default=None, help="Checkpoint file name.")
 parser.add_argument('--data_url', default=None, help='Directory contains dataset.')
 parser.add_argument('--train_url', default=None, help='Directory contains checkpoint file')
 parser.add_argument("--file_name", type=str, default="dcgan", help="output file name.")
 parser.add_argument("--file_format", type=str, default="MINDIR", help="file format")
-parser.add_argument("--only_load_netG", type=str, default=False, help="export only load netG, default is false.")
+parser.add_argument("--load_netG", type=str, default=False, help="export  netG, default is false.")
+parser.add_argument("--load_netD", type=str, default=True, help="export  netD for infer, default is True.")
+parser.add_argument("--load_G_and_D", type=str, default=False, help="export  netG and netD, default is false.")
 args = parser.parse_args()
 
 if args.run_modelart:
@@ -131,31 +133,27 @@ if args.run_modelart:
     context.set_context(mode=context.GRAPH_MODE, device_target="Ascend",
                         save_graphs=False)
     context.set_context(device_id=device_id)
-
     import moxing as mox
     mox.file.copy_parallel(src_url=args.ckpt_url, dst_url=local_ckpt_url)
+    local_ckpt_url = local_ckpt_url + args.ckpt_file
 else:
-    local_ckpt_url = args.ckpt_url + args.ckpt_file
+    local_ckpt_url = args.ckpt_file
     device_target = args.device_target
     device_id = args.device_id
     context.set_context(mode=context.GRAPH_MODE, device_target=device_target, save_graphs=False, device_id=device_id)
 
 
 if __name__ == '__main__':
-    if args.run_modelart:
-        dcgan = load_dcgan(local_ckpt_url + args.ckpt_file)
+    if args.load_netD:
+        dcgan = load_dcgan(local_ckpt_url)
         d_conv1, d_leakyReLU1, d_conv2, d_bm1, d_leakyReLU2, d_conv3 = load_discriminator(dcgan)
         discriminator_convert = DiscriminatorConvert(conv1=d_conv1, leakyReLU1=d_leakyReLU1, conv2=d_conv2, bm1=d_bm1,
                                                      leakyReLU2=d_leakyReLU2, conv3=d_conv3)
         discriminator_convert.set_train(False)
 
-        inputs = Tensor(np.random.rand(1, 3, 32, 32), mstype.float32)
+        inputs = Tensor(np.random.rand(args.batch_size, 3, 32, 32), mstype.float32)
         export(discriminator_convert, inputs, file_name=args.file_name, file_format=args.file_format)
-        file_name = args.file_name + "." + args.file_format.lower()
-        if args.run_modelart:
-            mox.file.copy_parallel(src_url=file_name,
-                                   dst_url=os.path.join(args.ckpt_url, file_name))
-    elif args.only_load_netG:
+    elif args.load_netG:
         dcgan = load_dcgan(local_ckpt_url)
         netG_trained = dcgan.myTrainOneStepCellForG.network.netG
         netG_trained.set_train(False)
@@ -168,3 +166,7 @@ if __name__ == '__main__':
         latent_code = Tensor(np.random.rand(args.batch_size, 100, 1, 1), mstype.float32)
         inputs = [real_data, latent_code]
         export(dcgan, *inputs, file_name=args.file_name, file_format=args.file_format)
+    if args.run_modelart:
+        file_name = args.file_name + "." + args.file_format.lower()
+        mox.file.copy_parallel(src_url=file_name,
+                               dst_url=os.path.join(args.ckpt_url, file_name))
diff --git a/research/cv/dcgan/gpu_infer/CMakeLists.txt b/research/cv/dcgan/gpu_infer/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..fe0084e53564dbbb9cf5281c86601a941a5a8324
--- /dev/null
+++ b/research/cv/dcgan/gpu_infer/CMakeLists.txt
@@ -0,0 +1,16 @@
+cmake_minimum_required(VERSION 3.14.1)
+project(GpuInfer)
+add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g -std=c++17 -Werror -Wall -fPIE -Wl,--allow-shlib-undefined")
+set(PROJECT_SRC_ROOT ${CMAKE_CURRENT_LIST_DIR}/)
+option(MINDSPORE_PATH "mindspore install path" "")
+include_directories(${MINDSPORE_PATH})
+include_directories(${MINDSPORE_PATH}/include)
+include_directories(${PROJECT_SRC_ROOT})
+find_library(MS_LIB libmindspore.so ${MINDSPORE_PATH}/lib)
+file(GLOB_RECURSE MD_LIB ${MINDSPORE_PATH}/_c_dataengine*)
+
+add_executable(main src/main.cc src/utils.cc)
+find_package(gflags REQUIRED)
+target_link_libraries(main ${MS_LIB} ${MD_LIB} gflags)
+
diff --git a/research/cv/dcgan/gpu_infer/build.sh b/research/cv/dcgan/gpu_infer/build.sh
new file mode 100644
index 0000000000000000000000000000000000000000..cad23b6251e7cbe6bc7635b740626dd920c3963a
--- /dev/null
+++ b/research/cv/dcgan/gpu_infer/build.sh
@@ -0,0 +1,28 @@
+#!/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.
+# ============================================================================
+if [ -d out ]; then
+    rm -rf out
+fi
+
+mkdir out
+cd out || exit
+
+if [ -f "Makefile" ]; then
+  make clean
+fi
+cmake .. \
+    -DMINDSPORE_PATH="`pip show mindspore-gpu | grep Location | awk '{print $2"/mindspore"}' | xargs realpath`"
+make
\ No newline at end of file
diff --git a/research/cv/dcgan/gpu_infer/inc/utils.h b/research/cv/dcgan/gpu_infer/inc/utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..492ce809487ce5c6e85e20b3cf071094988b1708
--- /dev/null
+++ b/research/cv/dcgan/gpu_infer/inc/utils.h
@@ -0,0 +1,36 @@
+/**
+ * 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.
+ */
+
+#ifndef MINDSPORE_INFERENCE_UTILS_H_
+#define MINDSPORE_INFERENCE_UTILS_H_
+
+#include <sys/stat.h>
+#include <dirent.h>
+#include <vector>
+#include <string>
+#include <memory>
+#include "include/api/types.h"
+
+std::vector<std::string> GetAllFiles(std::string_view dirName);
+DIR *OpenDir(std::string_view dirName);
+std::string RealPath(std::string_view path);
+mindspore::MSTensor ReadFileToTensor(const std::string &file);
+int WriteResult(const std::string& imageFile, const std::vector<mindspore::MSTensor> &outputs, const std::string& mode);
+std::vector<std::string> GetAllFiles(std::string dir_name);
+std::vector<std::vector<std::string>> GetAllInputData(std::string dir_name);
+
+#endif
+
diff --git a/research/cv/dcgan/gpu_infer/src/main.cc b/research/cv/dcgan/gpu_infer/src/main.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f083b0a5964e2bbc8266b6a554d2a8554e2502d9
--- /dev/null
+++ b/research/cv/dcgan/gpu_infer/src/main.cc
@@ -0,0 +1,116 @@
+/**
+ * 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.
+ */
+
+#include <sys/time.h>
+#include <gflags/gflags.h>
+#include <dirent.h>
+#include <iostream>
+#include <string>
+#include <algorithm>
+#include <iosfwd>
+#include <vector>
+#include <fstream>
+
+#include "../inc/utils.h"
+#include "include/dataset/execute.h"
+#include "include/dataset/transforms.h"
+#include "include/dataset/vision.h"
+#include "include/api/types.h"
+#include "include/api/model.h"
+#include "include/api/serialization.h"
+#include "include/api/context.h"
+
+using mindspore::Serialization;
+using mindspore::Model;
+using mindspore::Context;
+using mindspore::Status;
+using mindspore::ModelType;
+using mindspore::Graph;
+using mindspore::GraphCell;
+using mindspore::kSuccess;
+using mindspore::MSTensor;
+using mindspore::DataType;
+using mindspore::dataset::Execute;
+using mindspore::dataset::TensorTransform;
+using mindspore::dataset::vision::Decode;
+using mindspore::dataset::vision::Resize;
+using mindspore::dataset::vision::Normalize;
+using mindspore::dataset::vision::HWC2CHW;
+
+DEFINE_string(mindir_path, "", "model path");
+DEFINE_string(dataset_path, "", "dataset path");
+DEFINE_int32(device_id, 0, "device id");
+DEFINE_string(mode, "", "train or test");
+
+int main(int argc, char **argv) {
+    gflags::ParseCommandLineFlags(&argc, &argv, true);
+
+    Model model;
+
+    std::vector<MSTensor> model_inputs;
+    if (RealPath(FLAGS_mindir_path).empty()) {
+        std::cout << "Invalid mindir" << std::endl;
+        return -1;
+    }
+
+    auto context = std::make_shared<Context>();
+    auto gpu_device_info = std::make_shared<mindspore::GPUDeviceInfo>();
+    gpu_device_info->SetDeviceID(FLAGS_device_id);
+    context->MutableDeviceInfo().push_back(gpu_device_info);
+    mindspore::Graph graph;
+    Serialization::Load(FLAGS_mindir_path, ModelType::kMindIR, &graph);
+
+    Status ret_build = model.Build(GraphCell(graph), context);
+    if (ret_build != kSuccess) {
+        std::cout << "ERROR: Build failed." << std::endl;
+        return -1;
+    }
+
+    model_inputs = model.GetInputs();
+    if (model_inputs.empty()) {
+        std::cout << "Invalid model, inputs is empty." << std::endl;
+        return -1;
+    }
+
+    auto input0_files = GetAllFiles(FLAGS_dataset_path);
+    if (input0_files.empty()) {
+        std::cout << "ERROR: no input data." << std::endl;
+        return 1;
+    }
+    size_t size = input0_files.size();
+    for (size_t i = 0; i < size; ++i) {
+        std::vector<MSTensor> inputs;
+        std::vector<MSTensor> outputs;
+        std::cout << "Start predict input files:" << input0_files[i] <<std::endl;
+        auto input0 = ReadFileToTensor(input0_files[i]);
+        inputs.emplace_back(model_inputs[0].Name(), model_inputs[0].DataType(), model_inputs[0].Shape(),
+                            input0.Data().get(), input0.DataSize());
+
+        Status ret_predict = model.Predict(inputs, &outputs);
+        if (ret_predict != kSuccess) {
+            std::cout << "Predict " << input0_files[i] << " failed." << std::endl;
+            return 1;
+        }
+
+        int rst = WriteResult(input0_files[i], outputs, FLAGS_mode);
+        if (rst != 0) {
+            std::cout << "write result failed." << std::endl;
+            return rst;
+        }
+    }
+
+    return 0;
+}
diff --git a/research/cv/dcgan/gpu_infer/src/utils.cc b/research/cv/dcgan/gpu_infer/src/utils.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d80922e13848100c82f113866528ee784f98c25f
--- /dev/null
+++ b/research/cv/dcgan/gpu_infer/src/utils.cc
@@ -0,0 +1,195 @@
+/**
+ * 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.
+ */
+
+#include <fstream>
+#include <algorithm>
+#include <iostream>
+#include "inc/utils.h"
+
+using mindspore::MSTensor;
+using mindspore::DataType;
+
+std::vector<std::vector<std::string>> GetAllInputData(std::string dir_name) {
+    std::vector<std::vector<std::string>> ret;
+
+    DIR *dir = OpenDir(dir_name);
+    if (dir == nullptr) {
+        return {};
+    }
+    struct dirent *filename;
+    /* read all the files in the dir ~ */
+    std::vector<std::string> sub_dirs;
+    while ((filename = readdir(dir)) != nullptr) {
+        std::string d_name = std::string(filename->d_name);
+        // get rid of "." and ".."
+        if (d_name == "." || d_name == ".." || d_name.empty()) {
+            continue;
+        }
+        std::string dir_path = RealPath(std::string(dir_name) + "/" + filename->d_name);
+        struct stat s;
+        lstat(dir_path.c_str(), &s);
+        if (!S_ISDIR(s.st_mode)) {
+            continue;
+        }
+
+        sub_dirs.emplace_back(dir_path);
+    }
+    std::sort(sub_dirs.begin(), sub_dirs.end());
+
+    (void)std::transform(sub_dirs.begin(), sub_dirs.end(), std::back_inserter(ret),
+                         [](const std::string &d) { return GetAllFiles(d); });
+
+    return ret;
+}
+
+std::vector<std::string> GetAllFiles(std::string dir_name) {
+    struct dirent *filename;
+    DIR *dir = OpenDir(dir_name);
+    if (dir == nullptr) {
+        return {};
+    }
+    std::vector<std::string> res;
+    while ((filename = readdir(dir)) != nullptr) {
+        std::string d_name = std::string(filename->d_name);
+        if (d_name == "." || d_name == ".." || d_name.size() <= 3) {
+          continue;
+        }
+        res.emplace_back(std::string(dir_name) + "/" + filename->d_name);
+    }
+    std::sort(res.begin(), res.end());
+    return res;
+}
+
+std::vector<std::string> GetAllFiles(std::string_view dirName) {
+    std::cout << "string_view" << std::endl;
+    struct dirent *filename;
+    DIR *dir = OpenDir(dirName);
+    if (dir == nullptr) {
+        return {};
+    }
+    std::vector<std::string> res;
+    while ((filename = readdir(dir)) != nullptr) {
+        std::string dName = std::string(filename->d_name);
+        if (dName == "." || dName == ".." || filename->d_type != DT_REG) {
+           continue;
+        }
+        res.emplace_back(std::string(dirName) + "/" + filename->d_name);
+    }
+    std::sort(res.begin(), res.end());
+    for (auto &f : res) {
+        std::cout << "image file: " << f << std::endl;
+    }
+    return res;
+}
+
+int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs, const std::string& mode) {
+    std::string homePath = "./result_Files_"+mode;
+    const int INVALID_POINTER = -1;
+    const int ERROR = -2;
+    for (size_t i = 0; i < outputs.size(); ++i) {
+        size_t outputSize;
+        std::shared_ptr<const void> netOutput;
+        netOutput = outputs[i].Data();
+        outputSize = outputs[i].DataSize();
+        int pos = imageFile.rfind('/');
+        std::string fileName(imageFile, pos + 1);
+        fileName.replace(fileName.find('.'), fileName.size() - fileName.find('.'), "_"+mode+"_" + std::to_string(i)
+        + ".bin");
+        std::string outFileName = homePath + "/" + fileName;
+        FILE *outputFile = fopen(outFileName.c_str(), "wb");
+        if (outputFile == nullptr) {
+            std::cout << "open result file " << outFileName << " failed" << std::endl;
+            return INVALID_POINTER;
+        }
+        size_t size = fwrite(netOutput.get(), sizeof(char), outputSize, outputFile);
+        if (size != outputSize) {
+            fclose(outputFile);
+            outputFile = nullptr;
+            std::cout << "write result file " << outFileName << " failed, write size[" << size <<
+                "] is smaller than output size[" << outputSize << "], maybe the disk is full." << std::endl;
+            return ERROR;
+        }
+        fclose(outputFile);
+        std::cout << "save result file " << outFileName << " success" << std::endl;
+        outputFile = nullptr;
+    }
+    return 0;
+}
+
+mindspore::MSTensor ReadFileToTensor(const std::string &file) {
+    if (file.empty()) {
+        std::cout << "Pointer file is nullptr" << std::endl;
+        return mindspore::MSTensor();
+    }
+
+    std::ifstream ifs(file);
+    if (!ifs.good()) {
+        std::cout << "File: " << file << " is not exist" << std::endl;
+        return mindspore::MSTensor();
+    }
+
+    if (!ifs.is_open()) {
+        std::cout << "File: " << file << "open failed" << std::endl;
+        return mindspore::MSTensor();
+    }
+
+    ifs.seekg(0, std::ios::end);
+    size_t size = ifs.tellg();
+    mindspore::MSTensor buffer(file, mindspore::DataType::kNumberTypeUInt8,
+    {static_cast<int64_t>(size)}, nullptr, size);
+
+    ifs.seekg(0, std::ios::beg);
+    ifs.read(reinterpret_cast<char *>(buffer.MutableData()), size);
+    ifs.close();
+
+    return buffer;
+}
+
+DIR *OpenDir(std::string_view dirName) {
+    if (dirName.empty()) {
+        std::cout << " dirName is null ! " << std::endl;
+        return nullptr;
+    }
+    std::string realPath = RealPath(dirName);
+    struct stat s;
+    lstat(realPath.c_str(), &s);
+    if (!S_ISDIR(s.st_mode)) {
+        std::cout << "dirName is not a valid directory !" << std::endl;
+        return nullptr;
+    }
+    DIR *dir;
+    dir = opendir(realPath.c_str());
+    if (dir == nullptr) {
+        std::cout << "Can not open dir " << dirName << std::endl;
+        return nullptr;
+    }
+    std::cout << "Successfully opened the dir " << dirName << std::endl;
+    return dir;
+}
+
+std::string RealPath(std::string_view path) {
+    char realPathMem[PATH_MAX] = {0};
+    char *realPathRet = nullptr;
+    realPathRet = realpath(path.data(), realPathMem);
+    if (realPathRet == nullptr) {
+        std::cout << "File: " << path << " is not exist.";
+        return "";
+    }
+
+    std::string realPath(realPathMem);
+    std::cout << path << " realpath is: " << realPath << std::endl;
+    return realPath;
+}
diff --git a/research/cv/dcgan/requirements.txt b/research/cv/dcgan/requirements.txt
new file mode 100644
index 0000000000000000000000000000000000000000..8ba3246ed29ebf9ac7294238d22013d8ff2c619f
--- /dev/null
+++ b/research/cv/dcgan/requirements.txt
@@ -0,0 +1,3 @@
+numpy
+matplotlib
+scikit-learn
\ No newline at end of file
diff --git a/research/cv/dcgan/scripts/run_distribute_train.sh b/research/cv/dcgan/scripts/run_distribute_train_ascend.sh
similarity index 90%
rename from research/cv/dcgan/scripts/run_distribute_train.sh
rename to research/cv/dcgan/scripts/run_distribute_train_ascend.sh
index fe7b7ee4be7e0a27c4759012388d1e8450cb0494..9e8206fd4d311485f42b8b90c7263bec3d428eed 100644
--- a/research/cv/dcgan/scripts/run_distribute_train.sh
+++ b/research/cv/dcgan/scripts/run_distribute_train_ascend.sh
@@ -16,7 +16,7 @@
 
 if [ $# != 3 ]
 then
-    echo "Usage: bash run_distribute_train.sh [RANK_TABLE_FILE] [DATA_URL] [TRAIN_URL]"
+    echo "Usage: bash run_distribute_train_ascend.sh [RANK_TABLE_FILE] [DATA_URL] [TRAIN_URL]"
 exit 1
 fi
 
@@ -81,7 +81,7 @@ do
     cd ./train_parallel$i || exit
     echo "start training for rank $RANK_ID, device $DEVICE_ID"
     env > env.log
-    taskset -c $cmdopt nohup python -u train.py --device_id=$i --run_distribute=True \
+    taskset -c $cmdopt nohup python -u train.py --device_target=Ascend --device_id=$i --run_distribute=True \
                     --data_url=$PATH2 --train_url=$PATH3 > distribute_train_log 2>&1 &
     cd ..
 done
diff --git a/research/cv/dcgan/scripts/run_distribute_train_gpu.sh b/research/cv/dcgan/scripts/run_distribute_train_gpu.sh
new file mode 100644
index 0000000000000000000000000000000000000000..19d0d3cf4c1e43c102ec569c931ee84675dfb14f
--- /dev/null
+++ b/research/cv/dcgan/scripts/run_distribute_train_gpu.sh
@@ -0,0 +1,75 @@
+#!/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.
+# ============================================================================
+
+if [ $# != 4 ]
+then
+    echo "Usage: bash run_distribute_train_gpu.sh [DEVICE_NUM] [CUDA_VISIBLE_DEVICES] [DATA_URL] [TRAIN_URL]"
+exit 1
+fi
+
+get_real_path(){
+  if [ "${1:0:1}" == "/" ]; then
+    echo "$1"
+  else
+    echo "$(realpath -m $PWD/$1)"
+  fi
+}
+PATH1=$3
+PATH2=$(get_real_path $4)
+
+if [ $1 -lt 1 ] && [ $1 -gt 8 ]
+then
+    echo "error: DEVICE_NUM=$1 is not in (1-8)"
+    exit 1
+fi
+
+if [ ! -d $PATH1 ]
+then
+    echo "error: TRAIN_URL=$PATH1 is not a directory"
+exit 1
+fi
+
+if [ ! -d $PATH2 ]
+then
+    echo "error: DATA_URL=$PATH2 is not a directory"
+exit 1
+fi
+
+echo "DEVICE_NUM:" $1
+echo "CUDA_VISIBLE_DEVICES:" $2
+echo "DATA_URL:" $PATH1
+echo "TRAIN_URL:" $PATH2
+
+ulimit -c unlimited
+export DEVICE_NUM=$1
+export RANK_SIZE=$1
+export CUDA_VISIBLE_DEVICES=$2
+
+rm -rf ./train_parallel
+mkdir ./train_parallel
+mkdir ./train_parallel/scripts
+cp ../*.py ./train_parallel
+cp *.sh ./train_parallel/scripts
+cp -r ../src ./train_parallel
+cp -r ../gpu_infer ./train_parallel
+cd ./train_parallel || exit
+mpirun -n $DEVICE_NUM --output-filename log_output --merge-stderr-to-stdout --allow-run-as-root python train.py --device_target GPU --run_distribute True\
+                      --data_url $PATH1 --train_url $PATH2 > output.train.dis_log 2>&1 &
+cd ..
+
+
+
+
diff --git a/research/cv/dcgan/scripts/run_eval_ascend.sh b/research/cv/dcgan/scripts/run_eval_ascend.sh
new file mode 100644
index 0000000000000000000000000000000000000000..4c25ecaed2103ea714c07826bb479ae51c268546
--- /dev/null
+++ b/research/cv/dcgan/scripts/run_eval_ascend.sh
@@ -0,0 +1,66 @@
+#!/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.
+# ============================================================================
+
+if [ $# != 3 ]
+then
+    echo "Usage: sh run_eval.sh [IMG_URL] [CKPT_URL] [DEVICE_ID]"
+exit 1
+fi
+
+get_real_path(){
+  if [ "${1:0:1}" == "/" ]; then
+    echo "$1"
+  else
+    echo "$(realpath -m $PWD/$1)"
+  fi
+}
+
+PATH1=$(get_real_path $1)
+PATH2=$(get_real_path $2)
+
+if [ ! -d $PATH1 ]
+then
+    echo "error: IMG_URL=$PATH1 is not a directory"
+exit 1
+fi
+
+if [ ! -f $PATH2 ]
+then
+    echo "error: CKPT_URL=$PATH2 is not a file"
+exit 1
+fi
+
+ulimit -c unlimited
+export DEVICE_NUM=1
+export RANK_SIZE=$DEVICE_NUM
+export DEVICE_ID=$3
+export RANK_ID=$DEVICE_ID
+
+
+if [ -d "eval" ];
+then
+    rm -rf ./eval
+fi
+mkdir ./eval
+cp ../*.py ./eval
+cp *.sh ./eval
+cp -r ../src ./eval
+cd ./eval || exit
+env > env.log
+echo "start evaluation for device $DEVICE_ID"
+nohup python -u eval.py --device_id=$DEVICE_ID --img_url=$PATH1 --ckpt_url=$PATH2 --device_target=Ascend> eval_log 2>&1 &
+cd ..
+
diff --git a/research/cv/dcgan/scripts/run_eval.sh b/research/cv/dcgan/scripts/run_eval_gpu.sh
similarity index 83%
rename from research/cv/dcgan/scripts/run_eval.sh
rename to research/cv/dcgan/scripts/run_eval_gpu.sh
index 5910f20c2d4d4b28d0d94458d0d8854bdb8cbd7c..fc65499afac74e784214a853e7536b9426343746 100644
--- a/research/cv/dcgan/scripts/run_eval.sh
+++ b/research/cv/dcgan/scripts/run_eval_gpu.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 2021 Huawei Technologies Co., Ltd
+# 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.
@@ -14,9 +14,9 @@
 # limitations under the License.
 # ============================================================================
 
-if [ $# != 2 ]
+if [ $# != 3 ]
 then
-    echo "Usage: sh run_eval.sh [IMG_URL] [CKPT_URL]"
+    echo "Usage: sh run_eval.sh [IMG_URL] [CKPT_URL] [DEVICE_ID]"
 exit 1
 fi
 
@@ -43,12 +43,11 @@ then
 exit 1
 fi
 
-ulimit -u unlimited
+ulimit -c unlimited
 export DEVICE_NUM=1
-export DEVICE_ID=0
 export RANK_SIZE=$DEVICE_NUM
-export RANK_ID=0
-
+export DEVICE_ID=$3
+export RANK_ID=$DEVICE_ID
 if [ -d "eval" ];
 then
     rm -rf ./eval
@@ -60,6 +59,6 @@ cp -r ../src ./eval
 cd ./eval || exit
 env > env.log
 echo "start evaluation for device $DEVICE_ID"
-nohup python -u eval.py --device_id=$DEVICE_ID --img_url=$PATH1 --ckpt_url=$PATH2 > eval_log 2>&1 &
+nohup python -u eval.py --device_id=$DEVICE_ID --img_url=$PATH1 --ckpt_url=$PATH2 --device_target=GPU> eval_log 2>&1 &
 cd ..
 
diff --git a/research/cv/dcgan/scripts/run_infer_310.sh b/research/cv/dcgan/scripts/run_infer_310.sh
index 59bb2f70d6d1bbbe390e2c827ad0e297e957d680..867de42595d712ab3664d2092ac98de4bb78e05d 100644
--- a/research/cv/dcgan/scripts/run_infer_310.sh
+++ b/research/cv/dcgan/scripts/run_infer_310.sh
@@ -14,7 +14,7 @@
 # limitations under the License.
 # ============================================================================
 if [[ $# -lt 2 || $# -gt 3 ]]; then
-    echo "Usage: bash run_infer_310.sh [MINDIR_PATH] [DATASET_PATH] [DEVICE_ID]
+    echo "Usage: bash run_infer_310.sh [MINDIR_PATH] [DATA_URL] [DEVICE_ID]
     DEVICE_ID is optional, it can be set by environment variable device_id, otherwise the value is zero"
 exit 1
 fi
@@ -100,7 +100,7 @@ function infer_test()
 }
 function post_process()
 {
-    nohup python -u ../verifyBySklSvmNetD_20_all_310.py --device_id $device_id >> verify_log 2>&1 &
+    nohup python -u ../verify.py >> verify_log 2>&1 &
 }
 
 preprocess_data
diff --git a/research/cv/dcgan/scripts/run_infer_gpu.sh b/research/cv/dcgan/scripts/run_infer_gpu.sh
new file mode 100644
index 0000000000000000000000000000000000000000..476913ee76a9d577ca0cc5dff5b960547833727e
--- /dev/null
+++ b/research/cv/dcgan/scripts/run_infer_gpu.sh
@@ -0,0 +1,110 @@
+#!/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.
+# ============================================================================
+if [[ $# -lt 2 || $# -gt 3 ]]; then
+    echo "Usage: bash run_infer_gpu.sh [MINDIR_PATH] [DATASET_PATH] [DEVICE_ID]
+    DEVICE_ID is optional, it can be set by environment variable device_id, otherwise the value is zero"
+exit 1
+fi
+get_real_path(){
+
+  if [ "${1:0:1}" == "/" ]; then
+        echo "$1"
+    else
+        echo "$(realpath -m $PWD/$1)"
+    fi
+}
+model=$(get_real_path $1)
+dataset_path=$(get_real_path $2)
+device_id=0
+if [ $# == 3 ]; then
+    device_id=$3
+fi
+echo "mindir name: "$model
+echo "dataset path: "$dataset_path
+echo "device id: "$device_id
+export LD_PRELOAD=/root/anaconda3/lib/libpython3.7m.so
+export PYTHONPATH=/home/mindspore/.local/lib/python3.7/site-packages
+export LD_LIBRARY_PATH=/usr/local/lib64/:$LD_LIBRARY_PATH
+function preprocess_data()
+{
+   if [ -d preprocess_Result ]; then
+       rm -rf ./preprocess_Result
+    fi
+    mkdir preprocess_Result
+    python3.7 ../preprocess.py --data_path=$dataset_path
+}
+function compile_app()
+{
+    cd ../gpu_infer/ || exit
+    bash build.sh &> build.log
+}
+function infer_train()
+{
+    cd - || exit
+    if [ -d result_Files_train ]; then
+        rm -rf ./result_Files_train
+    fi
+    if [ -d time_Result ]; then
+        rm -rf ./time_Result
+    fi
+    mkdir result_Files_train
+    mkdir time_Result
+
+    ../gpu_infer/out/main --mindir_path=$model --dataset_path=./preprocess_Result/train_data --device_id=$device_id --mode=train &> infer_train.log
+}
+function infer_test()
+{
+    if [ -d result_Files_test ]; then
+        rm -rf ./result_Files_test
+    fi
+    if [ -d time_Result ]; then
+        rm -rf ./time_Result
+    fi
+    mkdir result_Files_test
+    mkdir time_Result
+
+    ../gpu_infer/out/main --mindir_path=$model --dataset_path=./preprocess_Result/test_data --device_id=$device_id --mode=test &> infer_test.log
+}
+function post_process()
+{
+    nohup python -u ../verify.py >> verify_log 2>&1 &
+}
+
+preprocess_data
+if [ $? -ne 0 ]; then
+    echo "preprocess dataset failed"
+    exit 1
+fi
+compile_app
+if [ $? -ne 0 ]; then
+    echo "compile app code failed"
+    exit 1
+fi
+infer_train
+if [ $? -ne 0 ]; then
+    echo " execute inference train failed"
+    exit 1
+fi
+infer_test
+if [ $? -ne 0 ]; then
+    echo " execute inference test failed"
+    exit 1
+fi
+post_process
+if [ $? -ne 0 ]; then
+    echo " execute post_process failed"
+    exit 1
+fi
\ No newline at end of file
diff --git a/research/cv/dcgan/scripts/run_standalone_train.sh b/research/cv/dcgan/scripts/run_standalone_train_ascend.sh
similarity index 86%
rename from research/cv/dcgan/scripts/run_standalone_train.sh
rename to research/cv/dcgan/scripts/run_standalone_train_ascend.sh
index 1c66890e18026dd75f22ce6d8e84b3ee5d042d5a..f5c47e7c8d390a45ca98306f7ee4586f556dc85e 100644
--- a/research/cv/dcgan/scripts/run_standalone_train.sh
+++ b/research/cv/dcgan/scripts/run_standalone_train_ascend.sh
@@ -16,7 +16,7 @@
 
 if [ $# != 3 ]
 then
-    echo "Usage: bash run_standalone_train.sh [DEVICE_ID] [DATA_URL] [TRAIN_URL]"
+    echo "Usage: bash run_standalone_train_ascend.sh [DEVICE_ID] [DATA_URL] [TRAIN_URL]"
 exit 1
 fi
 
@@ -64,5 +64,5 @@ cp -r ../src ./train
 cd ./train || exit
 echo "start training for device $ID"
 env > env.log
-nohup python -u train.py --device_id=$ID --data_url=$PATH1 --train_url=$PATH2 > train_log 2>&1 &
+nohup python -u train.py --device_target=Ascend --device_id=$ID --data_url=$PATH1 --train_url=$PATH2 > train_log 2>&1 &
 cd ..
diff --git a/research/cv/dcgan/scripts/run_standalone_train_gpu.sh b/research/cv/dcgan/scripts/run_standalone_train_gpu.sh
new file mode 100644
index 0000000000000000000000000000000000000000..d3625b8971389c7979e907c02189816b1b266386
--- /dev/null
+++ b/research/cv/dcgan/scripts/run_standalone_train_gpu.sh
@@ -0,0 +1,70 @@
+#!/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.
+# ============================================================================
+
+if [ $# != 3 ]
+then
+    echo "Usage: bash run_standalone_train_gpu.sh [DEVICE_ID] [DATA_URL] [TRAIN_URL]"
+exit 1
+fi
+
+get_real_path(){
+  if [ "${1:0:1}" == "/" ]; then
+    echo "$1"
+  else
+    echo "$(realpath -m $PWD/$1)"
+  fi
+}
+
+ID=$1
+echo $ID
+PATH1=$2
+echo $PATH1
+PATH2=$(get_real_path $3)
+echo $PATH2
+
+if [ ! -d $PATH1 ]
+then
+    echo "error: DATA_URL=$PATH1 is not a directory"
+exit 1
+fi
+
+if [ ! -d $PATH2 ]
+then
+    echo "error: TRAIN_URL=$PATH2 is not a directory"
+exit 1
+fi
+
+ulimit -c unlimited
+export DEVICE_NUM=1
+export DEVICE_ID=$ID
+export RANK_ID=$ID
+export RANK_SIZE=1
+
+if [ -d "train" ];
+then
+    rm -rf ./train
+fi
+mkdir ./train
+mkdir ./train/scripts
+cp ../*.py ./train
+cp *.sh ./train/scripts
+cp -r ../src ./train
+cp -r ../gpu_infer ./train
+cd ./train || exit
+echo "start training for device $ID"
+env > env.log
+nohup python -u train.py --device_target=GPU --device_id=$ID --data_url=$PATH1 --train_url=$PATH2 > output.train_log 2>&1 &
+cd ..
diff --git a/research/cv/dcgan/train.py b/research/cv/dcgan/train.py
index efd7c1fa042fa2e4247b7f876454082b1adfc589..90dbaeba9ccc40ade3709dea6468833f5077312c 100644
--- a/research/cv/dcgan/train.py
+++ b/research/cv/dcgan/train.py
@@ -17,25 +17,25 @@
 import argparse
 import ast
 import os
+import time
 import datetime
 import numpy as np
-
 from mindspore import context
 from mindspore import nn, Tensor
 from mindspore.train.callback import CheckpointConfig, _InternalCallbackParam, ModelCheckpoint, RunContext
 from mindspore.context import ParallelMode
-from mindspore.communication.management import init, get_rank
+from mindspore.common import set_seed
+from mindspore.communication.management import init, get_rank, get_group_size
 from src.dataset import create_dataset_imagenet
 from src.config import dcgan_imagenet_cfg as cfg
 from src.generator import Generator
 from src.discriminator import Discriminator
 from src.cell import WithLossCellD, WithLossCellG
 from src.dcgan import DCGAN
-
 import matplotlib.pyplot as plt
 import matplotlib
 matplotlib.use('Agg')
-
+set_seed(1)
 
 def save_imgs(gen_imgs, idx):
     """
@@ -80,6 +80,7 @@ parser.add_argument("--run_modelart", type=ast.literal_eval, default=False,
                     help="Run on modelArt, default is false.")
 parser.add_argument("--run_distribute", type=ast.literal_eval, default=False,
                     help="Run distribute, default is false.")
+parser.add_argument('--device_target', type=str, default='Ascend', help='GPU or Ascend')
 parser.add_argument('--device_id', type=int, default=0, help='device id of Ascend (Default: 0)')
 parser.add_argument('--data_url', default=None, help='Directory contains ImageNet-1k dataset.')
 parser.add_argument('--train_url', default=None, help='Directory of training output.')
@@ -114,19 +115,32 @@ if run_modelart:
     mox.file.copy_parallel(src_url=args.losses_url, dst_url=local_losses_url)
 
 elif args.run_distribute:
-    device_id = args.device_id
-    context.set_context(mode=context.GRAPH_MODE, device_target="Ascend", save_graphs=False)
-    context.set_context(device_id=device_id)
-    init()
-    device_num = 1
-    context.set_auto_parallel_context(device_num=device_num, parallel_mode=ParallelMode.DATA_PARALLEL,
-                                      gradients_mean=True)
-    local_input_url = args.data_url
-    local_output_url = args.train_url
-    rank = get_rank()
+    if args.device_target == 'Ascend':
+        device_id = args.device_id
+        context.set_context(mode=context.GRAPH_MODE, device_target="Ascend", save_graphs=False)
+        context.set_context(device_id=device_id)
+        init()
+        device_num = 1
+        context.set_auto_parallel_context(device_num=device_num, parallel_mode=ParallelMode.DATA_PARALLEL,
+                                          gradients_mean=True)
+        local_input_url = args.data_url
+        local_output_url = args.train_url
+        rank = get_rank()
+    elif args.device_target == 'GPU':
+        context.set_context(mode=context.GRAPH_MODE, device_target='GPU', enable_graph_kernel=True)
+        init()
+        rank = get_rank()
+        device_num = get_group_size()
+        args.device_id = rank
+        context.set_auto_parallel_context(device_num=device_num, global_rank=rank,
+                                          parallel_mode=ParallelMode.DATA_PARALLEL,
+                                          gradients_mean=True)
+        local_input_url = args.data_url
+        local_output_url = args.train_url
 else:
     device_id = args.device_id
-    context.set_context(mode=context.GRAPH_MODE, device_target="Ascend", save_graphs=False)
+    device_target = args.device_target
+    context.set_context(mode=context.GRAPH_MODE, device_target=device_target, save_graphs=False)
     context.set_context(device_id=device_id)
     rank = 0
     device_num = 1
@@ -135,8 +149,9 @@ else:
 
 
 if __name__ == '__main__':
+    start = time.time()
     # Load Dataset
-    ds = create_dataset_imagenet(os.path.join(local_input_url), num_parallel_workers=2)
+    ds = create_dataset_imagenet(os.path.join(local_input_url), num_parallel_workers=4)
 
     steps_per_epoch = ds.get_dataset_size()
 
@@ -195,8 +210,9 @@ if __name__ == '__main__':
             G_losses.append(netG_loss.asnumpy())
             cb_params.cur_step_num = cb_params.cur_step_num + 1
         cb_params.cur_epoch_num = cb_params.cur_epoch_num + 1
-        print("================saving model===================")
+
         if args.device_id == 0 or not args.run_distribute:
+            print("================saving model===================")
             ckpt_cb.step_end(run_context)
             if run_modelart:
                 fake = netG(fixed_noise)
@@ -207,4 +223,6 @@ if __name__ == '__main__':
                 mox.file.copy_parallel(src_url=local_images_url, dst_url=args.images_url)
                 mox.file.copy_parallel(src_url=local_losses_url, dst_url=args.losses_url)
                 mox.file.copy_parallel(src_url=local_output_url, dst_url=args.train_url)
-        print("================success================")
+            print("================success================")
+    t = time.time() - start
+    print("train time:", t)
diff --git a/research/cv/dcgan/verifyBySklSvmNetD_20_all_310.py b/research/cv/dcgan/verify.py
similarity index 83%
rename from research/cv/dcgan/verifyBySklSvmNetD_20_all_310.py
rename to research/cv/dcgan/verify.py
index 934c122981015f026c29b97624efde2c5f90f58d..ff250d2e06efef27078bd1371ed7f6f6361ec1d2 100644
--- a/research/cv/dcgan/verifyBySklSvmNetD_20_all_310.py
+++ b/research/cv/dcgan/verify.py
@@ -1,4 +1,4 @@
-# Copyright 2021 Huawei Technologies Co., Ltd
+# Copyright 2021-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.
@@ -14,11 +14,7 @@
 # ============================================================================
 """verify by svm"""
 import time
-import argparse
 import numpy as np
-
-from mindspore import context
-
 from sklearn import svm
 from sklearn.preprocessing import StandardScaler
 
@@ -85,14 +81,5 @@ def verify_cifar10():
 
 
 if __name__ == '__main__':
-    parser = argparse.ArgumentParser(description='image production training')
-    parser.add_argument('--device_target', type=str, default='Ascend', choices=('Ascend', 'GPU'),
-                        help='device where the code will be implemented (default: Ascend)')
-    parser.add_argument('--device_id', type=int, default=0, help='device id of GPU or Ascend. (Default: 0)')
-    args = parser.parse_args()
-    device_target = args.device_target
-    device_id = args.device_id
-    context.set_context(mode=context.GRAPH_MODE, device_target=device_target, save_graphs=False, device_id=device_id)
-
     print("============================verify_cifar10")
     verify_cifar10()