Change function name and add dev doc

This commit is contained in:
learner2468 2023-12-05 17:10:46 +08:00
parent 57954fd523
commit 6d62350631
4 changed files with 29 additions and 6 deletions

View File

@ -7,7 +7,7 @@ from pyinfinitensor.onnx import OnnxStub, backend
import onnx import onnx
import itertools import itertools
def run_mnist_train_and_infer(): def run_cifar_train_and_infer():
paddle.device.set_device("gpu") paddle.device.set_device("gpu")
@ -78,4 +78,4 @@ def run_mnist_train_and_infer():
if __name__ == "__main__": if __name__ == "__main__":
run_mnist_train_and_infer() run_cifar_train_and_infer()

View File

@ -6,7 +6,7 @@ from pyinfinitensor.onnx import OnnxStub, backend
import onnx import onnx
import itertools import itertools
def run_mnist_train_and_infer(): def run_cifar_train_and_infer():
paddle.device.set_device("gpu") paddle.device.set_device("gpu")
@ -78,4 +78,4 @@ def run_mnist_train_and_infer():
if __name__ == "__main__": if __name__ == "__main__":
run_mnist_train_and_infer() run_cifar_train_and_infer()

View File

@ -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
```

View File

@ -8,7 +8,7 @@ import onnx
import itertools import itertools
from paddle.vision.models.resnet import BasicBlock from paddle.vision.models.resnet import BasicBlock
def run_mnist_train_and_infer(): def run_cifar_train_and_infer():
paddle.device.set_device("gpu") paddle.device.set_device("gpu")
@ -79,4 +79,4 @@ def run_mnist_train_and_infer():
if __name__ == "__main__": if __name__ == "__main__":
run_mnist_train_and_infer() run_cifar_train_and_infer()