Skip to content

Commit 594eb6b

Browse files
[Doc&Refine] Add IJCAI competetion in README (#886)
* add ijcai 2024 competetion information in README * refine symbolic module * Fix document(test=document_fix) * fix for pdiparams_path
1 parent c08f928 commit 594eb6b

File tree

8 files changed

+32
-14
lines changed

8 files changed

+32
-14
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
[**PaddleScience使用文档**](https://paddlescience-docs.readthedocs.io/zh/latest/)
1515

16+
🔥 [IJCAI 2024: 任意三维几何外形车辆的风阻快速预测竞赛](https://competition.atomgit.com/competitionInfo?id=7f3f276465e9e845fd3a811d2d6925b5),欢迎报名参赛。
17+
1618
<!-- --8<-- [start:description] -->
1719
## 👀简介
1820

deploy/python_infer/base.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Predictor:
3636
3737
Args:
3838
pdmodel_path (Optional[str]): Path to the PaddlePaddle model file. Defaults to None.
39-
pdpiparams_path (Optional[str]): Path to the PaddlePaddle model parameters file. Defaults to None.
39+
pdiparams_path (Optional[str]): Path to the PaddlePaddle model parameters file. Defaults to None.
4040
device (Literal["gpu", "cpu", "npu", "xpu"], optional): Device to use for inference. Defaults to "cpu".
4141
engine (Literal["native", "tensorrt", "onnx", "mkldnn"], optional): Inference engine to use. Defaults to "native".
4242
precision (Literal["fp32", "fp16", "int8"], optional): Precision to use for inference. Defaults to "fp32".
@@ -51,7 +51,7 @@ class Predictor:
5151
def __init__(
5252
self,
5353
pdmodel_path: Optional[str] = None,
54-
pdpiparams_path: Optional[str] = None,
54+
pdiparams_path: Optional[str] = None,
5555
*,
5656
device: Literal["gpu", "cpu", "npu", "xpu"] = "cpu",
5757
engine: Literal["native", "tensorrt", "onnx", "mkldnn"] = "native",
@@ -65,7 +65,7 @@ def __init__(
6565
num_cpu_threads: int = 10,
6666
):
6767
self.pdmodel_path = pdmodel_path
68-
self.pdpiparams_path = pdpiparams_path
68+
self.pdiparams_path = pdiparams_path
6969

7070
self._check_device(device)
7171
self.device = device
@@ -104,13 +104,13 @@ def _create_paddle_predictor(
104104
f"Given 'pdmodel_path': {self.pdmodel_path} does not exist. "
105105
"Please check if it is correct."
106106
)
107-
if not osp.exists(self.pdpiparams_path):
107+
if not osp.exists(self.pdiparams_path):
108108
raise FileNotFoundError(
109-
f"Given 'pdpiparams_path': {self.pdpiparams_path} does not exist. "
109+
f"Given 'pdiparams_path': {self.pdiparams_path} does not exist. "
110110
"Please check if it is correct."
111111
)
112112

113-
config = paddle_inference.Config(self.pdmodel_path, self.pdpiparams_path)
113+
config = paddle_inference.Config(self.pdmodel_path, self.pdiparams_path)
114114
if self.device == "gpu":
115115
config.enable_use_gpu(self.gpu_mem, self.gpu_id)
116116
if self.engine == "tensorrt":

deploy/python_infer/pinn_predictor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __init__(
3838
):
3939
super().__init__(
4040
cfg.INFER.pdmodel_path,
41-
cfg.INFER.pdpiparams_path,
41+
cfg.INFER.pdiparams_path,
4242
device=cfg.INFER.device,
4343
engine=cfg.INFER.engine,
4444
precision=cfg.INFER.precision,

docs/zh/examples/cylinder2d_unsteady.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
python cylinder2d_unsteady_Re100.py mode=eval EVAL.pretrained_model_path=https://paddle-org.bj.bcebos.com/paddlescience/models/cylinder2d_unsteady_Re100/cylinder2d_unsteady_Re100_pretrained.pdparams
2727
```
2828

29-
=== "模型导出命令"
29+
=== "模型导出命令"
3030

3131
``` sh
3232
python cylinder2d_unsteady_Re100.py mode=export

docs/zh/examples/cylinder2d_unsteady_transformer_physx.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,24 @@
4545
python train_transformer.py mode=infer
4646
```
4747

48+
=== "模型导出命令"
49+
50+
``` sh
51+
python train_transformer.py mode=export EMBEDDING_MODEL_PATH=https://paddle-org.bj.bcebos.com/paddlescience/models/cylinder/cylinder_pretrained.pdparams
52+
```
53+
54+
=== "模型推理命令"
55+
56+
``` sh
57+
# linux
58+
wget -nc https://paddle-org.bj.bcebos.com/paddlescience/datasets/transformer_physx/cylinder_training.hdf5 -P ./datasets/
59+
wget -nc https://paddle-org.bj.bcebos.com/paddlescience/datasets/transformer_physx/cylinder_valid.hdf5 -P ./datasets/
60+
# windows
61+
# curl https://paddle-org.bj.bcebos.com/paddlescience/datasets/transformer_physx/cylinder_training.hdf5 --output ./datasets/cylinder_training.hdf5
62+
# curl https://paddle-org.bj.bcebos.com/paddlescience/datasets/transformer_physx/cylinder_valid.hdf5 --output ./datasets/cylinder_valid.hdf5
63+
python train_transformer.py mode=infer
64+
```
65+
4866
| 模型 | MSE |
4967
| :-- | :-- |
5068
| [cylinder_transformer_pretrained.pdparams](https://paddle-org.bj.bcebos.com/paddlescience/models/cylinder/cylinder_transformer_pretrained.pdparams) | 1.093 |

examples/ldc/conf/ldc2d_steady_Re10.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ INFER:
6262
pretrained_model_path: https://paddle-org.bj.bcebos.com/paddlescience/models/ldc2d_steady_Re10/ldc2d_steady_Re10_pretrained.pdparams
6363
export_path: ./inference/ldc2d_steady_Re10
6464
pdmodel_path: ${INFER.export_path}.pdmodel
65-
pdpiparams_path: ${INFER.export_path}.pdiparams
65+
pdiparams_path: ${INFER.export_path}.pdiparams
6666
onnx_path: ${INFER.export_path}.onnx
6767
device: gpu
6868
engine: native

examples/tempoGAN/conf/tempogan.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ INFER:
9999
pretrained_model_path: https://paddle-org.bj.bcebos.com/paddlescience/models/tempoGAN/tempogan_pretrained.pdparams
100100
export_path: ./inference/tempoGAN
101101
pdmodel_path: ${INFER.export_path}.pdmodel
102-
pdpiparams_path: ${INFER.export_path}.pdiparams
102+
pdiparams_path: ${INFER.export_path}.pdiparams
103103
device: gpu
104104
engine: native
105105
precision: fp32

ppsci/utils/symbolic.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,17 +157,15 @@ def __repr__(self):
157157
return f"{self.__class__.__name__}(expr: {self.expr})"
158158

159159

160-
class DetachNode(nn.Layer):
160+
class DetachNode(Node):
161161
"""Class for detach operation in converted expression tree.
162162
163163
Args:
164164
expr (sp.Basic): Sympy expression.
165165
"""
166166

167167
def __init__(self, expr: sp.Basic):
168-
super().__init__()
169-
self.expr = expr
170-
self.key = _cvt_to_key(self.expr)
168+
super().__init__(expr)
171169
self.child = _cvt_to_key(self.expr.args[0])
172170

173171
def forward(self, data_dict: DATA_DICT):

0 commit comments

Comments
 (0)