Paddle 训练完的分割模型无法实现预测,执行指令报错

fykwrbwg  于 2021-11-29  发布在  Java
关注(0)|答案(1)|浏览(477)
  • 标题:训练完的分割模型无法实现预测,执行指令报错
  • 版本、环境信息:

   1)PaddlePaddle版本:2.1
   2)CPU:Apple M1
   3)GPU:无
   4)系统环境:MacOS 11.2.3 (20D91) python3.6

-预测信息
执行PaddleSeg/legacy/deploy/python/infer.py

python infer.py --conf=/Users/h3c/Downloads/deeplabv3p_mobilenetv2_face-2.yaml --input_dir=/Users/h3c/Desktop/kk1/202106230650264283081640/picture

yaml如下

DEPLOY:
    # 是否使用GPU预测
    USE_GPU: 0
    # 模型和参数文件所在目录路径
    MODEL_PATH: "/Users/h3c/Downloads/ss/aistudio/PaddleSeg/saved_model/deeplabv3p_mobilenetv2_face/best_model"
    # 模型文件名
    MODEL_FILENAME: "model.pdmodel"
    # 参数文件名
    PARAMS_FILENAME: "model.params"
    # 预测图片的的标准输入尺寸,输入尺寸不一致会做resize
    EVAL_CROP_SIZE: (513, 513)
    # 均值
    MEAN: [0.5, 0.5, 0.5]
    # 方差
    STD: [0.5, 0.5, 0.5]
    # 分类类型数
    NUM_CLASSES: 2
    # 图片通道数
    CHANNELS : 3
    # 预测模式,支持 NATIVE 和 ANALYSIS
    PREDICTOR_MODE: "ANALYSIS"
    # 每次预测的 batch_size
    BATCH_SIZE : 3

模型来源:
https://aistudio.baidu.com/aistudio/projectdetail/1217054

执行后报错:

Traceback (most recent call last):
File "infer.py", line 324, in
run(gflags.FLAGS.conf, gflags.FLAGS.input_dir, gflags.FLAGS.ext)
File "infer.py", line 304, in run
seg_predictor = Predictor(deploy_conf)
File "infer.py", line 195, ininit
self.predictor = fluid.core.create_paddle_predictor(predictor_config)
RuntimeError: (Unavailable) Getting 'tensor_desc' is not supported by the create_py_reader_1 type variable. (at /home/teamcity/work/ef54dc8a5b211854/paddle/fluid/framework/var_desc.cc:213)

是因为我是Apple M1吗?

eit6fx6z

eit6fx6z1#

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档常见问题历史IssueAI社区来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQGithub Issue and AI community to get the answer.Have a nice day!

相关问题