EXPERIMENT / 配套代码

verification.md

← 返回文章
# 实际运行记录

日期:2026-10-24。Python 3.13.9,Linux CPU 环境。将本包文件单独复制到临时目录执行,确认没有依赖其他文章目录。

```bash
python3 main.py
```

退出码 0,代码中的断言通过。

```text
ops {'Conv': 1, 'Constant': 4, 'Add': 1, 'Clip': 1, 'Mul': 1, 'Div': 1}
review against DEMO allowlist: ['Clip']
static input [1, 3, 16, 16] not a device compatibility result
```

## 验证范围

默认输入是构造数据或包内样例;只证明本课计算、接口和特定断言通过,不代表真实数据精度或板端性能。

## 环境版本

- torch: 2.13.0
- torchvision: 0.28.0
- numpy: 2.3.5
- onnx: 1.22.0
- onnxruntime: 1.28.0
- scipy: 1.16.3
- OpenCV (cv2): 5.0.0

上表记录可用环境,具体使用的库以 requirements.txt 为准;脚本均在 CPU 执行。

## 运行提示

```text
/tmp/edge-vision-verify-chwibad6/main.py:17: DeprecationWarning: You are using the legacy TorchScript-based ONNX export. Starting in PyTorch 2.9, the new torch.export-based ONNX exporter has become the default. Learn more about the new export logic: https://docs.pytorch.org/docs/stable/onnx_export.html. For exporting control flow: https://pytorch.org/tutorials/beginner/onnx/export_control_flow_model_to_onnx_tutorial.html
  path=Path(directory)/'graph.onnx';torch.onnx.export(net,(x,),str(path),opset_version=17,dynamo=False,input_names=['images'])
```