Environment Variable - Environment Variable - 3.0 English - UG1414

Vitis AI User Guide (UG1414)

Document_ID
UG1414
Release_Date
2023-02-24
Version
3.0 English

WEGO_ENABLE_AGGRESSIVE_SHAPE_INFERENCE

This environment variable can be enabled when some operators need to rely on batchsize to infer static shapes. Export WEGO_ENABLE_AGGRESSIVE_SHAPE_INFERENCE=1 will set batch size to 1. For example, the static shape of the reshape operator cannot be obtained for some models (For example, ssd_resnet_50_fpn_coco_tf model with input shape [-1,640,640,3]), resulting in an error when some WeGO subgraph is compiled by Vitis AI toolchain. The error message is as follows:

AssertionError: [ERROR] Invalid shape of input layer: shape: [1, -1, -1, 256] (N,H,W,C), name: input1
[INFO] parse raw model     :  0%|          | 0/52 [00:00<?, ?it/s]                           
*** Check failure stack trace: ***
To solve this problem, you need to set the environment variables as follows before running the sample to enable WeGO aggressive shape inference:
export WEGO_ENABLE_AGGRESSIVE_SHAPE_INFERENCE=1
Otherwise, you don't need this environment variable. Or, cancel the environment variable that has been set by the following command.
unset WEGO_ENABLE_AGGRESSIVE_SHAPE_INFERENCE