From 6d62350631f3bcb03a22f914a1c3061521aec16a Mon Sep 17 00:00:00 2001 From: learner2468 <19853611996@163.com> Date: Tue, 5 Dec 2023 17:10:46 +0800 Subject: [PATCH] Change function name and add dev doc --- examples/python/paddle_densenet.py | 4 ++-- examples/python/paddle_inception.py | 4 ++-- examples/python/paddle_model_dev.md | 23 +++++++++++++++++++++++ examples/python/paddle_resnet.py | 4 ++-- 4 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 examples/python/paddle_model_dev.md diff --git a/examples/python/paddle_densenet.py b/examples/python/paddle_densenet.py index 1c8c15fc..035de193 100644 --- a/examples/python/paddle_densenet.py +++ b/examples/python/paddle_densenet.py @@ -7,7 +7,7 @@ from pyinfinitensor.onnx import OnnxStub, backend import onnx import itertools -def run_mnist_train_and_infer(): +def run_cifar_train_and_infer(): paddle.device.set_device("gpu") @@ -78,4 +78,4 @@ def run_mnist_train_and_infer(): if __name__ == "__main__": - run_mnist_train_and_infer() \ No newline at end of file + run_cifar_train_and_infer() \ No newline at end of file diff --git a/examples/python/paddle_inception.py b/examples/python/paddle_inception.py index 97341a3c..16b70505 100644 --- a/examples/python/paddle_inception.py +++ b/examples/python/paddle_inception.py @@ -6,7 +6,7 @@ from pyinfinitensor.onnx import OnnxStub, backend import onnx import itertools -def run_mnist_train_and_infer(): +def run_cifar_train_and_infer(): paddle.device.set_device("gpu") @@ -78,4 +78,4 @@ def run_mnist_train_and_infer(): if __name__ == "__main__": - run_mnist_train_and_infer() \ No newline at end of file + run_cifar_train_and_infer() \ No newline at end of file diff --git a/examples/python/paddle_model_dev.md b/examples/python/paddle_model_dev.md new file mode 100644 index 00000000..65aee897 --- /dev/null +++ b/examples/python/paddle_model_dev.md @@ -0,0 +1,23 @@ +## Description + +This is a doc to tell you how to run paddle*.py in your machine. If your model run on other machines except Nvidia, you may need to make some change. + +## What do we do in paddle*.py files? + +1. Train model and evalute model with Cifar10 dataset + +2. Export paddle model to onnx model + +3. Load onnx model, nfer with InfiniTensor and + +## Command + +1. Go to `/examples/python` folder + +2. Run the following command + + 1. ``` + python paddle_resnet.py + python paddle_densenet.py + python paddle_inception.py + ``` diff --git a/examples/python/paddle_resnet.py b/examples/python/paddle_resnet.py index 93f19b58..bfd1e946 100644 --- a/examples/python/paddle_resnet.py +++ b/examples/python/paddle_resnet.py @@ -8,7 +8,7 @@ import onnx import itertools from paddle.vision.models.resnet import BasicBlock -def run_mnist_train_and_infer(): +def run_cifar_train_and_infer(): paddle.device.set_device("gpu") @@ -79,4 +79,4 @@ def run_mnist_train_and_infer(): if __name__ == "__main__": - run_mnist_train_and_infer() \ No newline at end of file + run_cifar_train_and_infer() \ No newline at end of file