开发者社区 > 大数据与机器学习 > 人工智能平台PAI > 正文

机器学习PAI用的镜像是这个 ,麻烦问下这个错误是啥原因呀 ?

机器学习PAI用的镜像是这个 alideeprec/deeprec-build:deeprec-dev-gpu-py38-cu116-ubuntu20.04

https://deeprec.readthedocs.io/zh/latest/DeepRec-Compile-And-Install.html根据这个文档编译了 libserving_processor.so 用python调用的时候,initialize 这一步发生了segment fault lQLPJwWFM9fm4bzNB-bNCSKwxFZ5qK4dnocE_LL9sgCfAA_2338_2022.png
配置的config如下 { "session_num": 1, "select_session_policy": "RR", "use_per_session_threads": false, "cpusets": "0,1,2,3", "gpu_ids_list": "0", "use_multi_stream": false, "enable_device_placement_optimization": false, "enable_inline_execute": false, "omp_num_threads": 1, "kmp_blocktime": 0, "feature_store_type": "local", "serialize_protocol": "protobuf", "inter_op_parallelism_threads": 1, "intra_op_parallelism_threads": 1, "model_update_inter_threads": 1, "model_update_intra_threads": 1, "init_timeout_minutes": 1, "signature_name": "serving_default", "warmup_file_name": "", "model_store_type": "local", "checkpoint_dir": "/app/llm/project/hupu/test/models/train_mmoe/result/", "savedmodel_dir": "/app/llm/project/hupu/test/models/train_mmoe/model/00123/", "timeline_start_step": 1, "timeline_interval_step": 2, "timeline_trace_count": 3, "timeline_path": "/app/llm/project/hupu/test/timeline", "ev_storage_type": 0}调用的python代码如下 from ctypes import cdll, c_char_p, c_int, POINTER, c_void_pimport jsonimport pdb# 加载.so文件lib = cdll.LoadLibrary('./lib/libserving_processor.so')# 设置initialize函数的参数类型和返回值类型lib.initialize.argtypes = [c_char_p, c_char_p, POINTER(c_int)]lib.initialize.restype = c_void_p# 设置process函数的参数类型和返回值类型lib.process.argtypes = [c_void_p, c_void_p, c_int, POINTER(c_void_p), POINTER(c_int)]lib.process.restype = c_int# 设置get_serving_model_info函数的参数类型和返回值类型lib.get_serving_model_info.argtypes = [c_void_p, POINTER(c_void_p), POINTER(c_int)]lib.get_serving_model_info.restype = c_int# 调用initialize函数with open('./lib/model_cfg.json') as f: cfg_data = json.load(f)json_str = json.dumps(cfg_data)cfg_bytes = json_str.encode('utf-8')# pdb.set_trace()state = c_int()model_buf = lib.initialize(b'model_entry', cfg_bytes, state)print("initial state: %d".format(state))pdb.set_trace()麻烦问下这个错误是啥原因呀 ?请问有没有使用python调用这个so的示例文档呢?

展开
收起
真的很搞笑 2023-09-25 10:28:05 456 0
1 条回答
写回答
取消 提交回答
  • 您好,根据您的错误信息,我们推测您可能使用了旧版本的镜像,建议您使用最新版本的镜像。您可以在PAI镜像列表中查看最新版本的镜像。

    2023-10-13 10:11:29
    赞同 展开评论 打赏

人工智能平台 PAI(Platform for AI,原机器学习平台PAI)是面向开发者和企业的机器学习/深度学习工程平台,提供包含数据标注、模型构建、模型训练、模型部署、推理优化在内的AI开发全链路服务,内置140+种优化算法,具备丰富的行业场景插件,为用户提供低门槛、高性能的云原生AI工程化能力。

相关产品

  • 人工智能平台 PAI
  • 热门讨论

    热门文章

    相关电子书

    更多
    大规模机器学习在蚂蚁+阿里的应用 立即下载
    阿里巴巴机器学习平台AI 立即下载
    微博机器学习平台架构和实践 立即下载