Pytorch1.1转换时候报错

基于pytorch1.1,自己训练了个模型文件:VOC.pkl

0_import_model.sh改写为:

#!/bin/bash

NAME=pytorch
ACUITY_PATH=…/bin/

convert_pytorch=${ACUITY_PATH}convertpytorch

$convert_pytorch --pytorch-model ./model/VOC.pkl --net-output cnn.json --data-output cnn.data --input-size-list ‘1,28,28’

执行0_import_model.sh转换时候报错如下:

cxhos@cxhos:~/actuity_linux_pytorch_COCO/conversion_scripts$ sudo sh 0_import_model.sh

Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings’

Current thread 0x00007f1afb7e0740 (most recent call first):
0_import_model.sh: line 8: 3555973 Aborted (core dumped) $convert_pytorch --pytorch-model ./model/VOC.pkl --net-output cnn.json --data-output cnn.data --input-size-list ‘1,28,28’

请教下是环境问题吗?

@kiwin

  1. 转换工具支持和Pytorch 1.2.
  2. 请通过SDK自带的文档,确认是否你模型的所有算子都支持。
  3. 转换支持pt格式Pytorch模型,不支持pkl格式。