ufownl / alpr_utils

ALPR model in unconstrained scenarios for Chinese license plates
GNU General Public License v3.0
169 stars 49 forks source link

请问ocr模型如何转成静态图的json模型去部署呢? #16

Closed ceyyso163 closed 4 years ago

ceyyso163 commented 4 years ago

net.hybridize() x = mx.ndarray.random.uniform(shape=(1, 3, 48, 144)) net(x, mx.ndarray.zeros((1, 9)), mx.ndarray.ones((1,)) * 9) net.export('ocr')

hybridize后再export报“Please first call block.hybridize() and then run forward with this block at least once before calling export.”错误

ufownl commented 4 years ago

@ceyyso163 目前实现 transformer 有用到 python 的动态控制流,所以那些自定义 block 都没有使用 HybridBlock,暂时无法通过 hybridize 生成静态图。