机器学习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
配置的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的示例文档呢?
您好,根据您的错误信息,我们推测您可能使用了旧版本的镜像,建议您使用最新版本的镜像。您可以在PAI镜像列表中查看最新版本的镜像。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
人工智能平台 PAI(Platform for AI,原机器学习平台PAI)是面向开发者和企业的机器学习/深度学习工程平台,提供包含数据标注、模型构建、模型训练、模型部署、推理优化在内的AI开发全链路服务,内置140+种优化算法,具备丰富的行业场景插件,为用户提供低门槛、高性能的云原生AI工程化能力。