Skip to content

  • 体验新版
    • 正在加载...
  • 登录
  • PaddlePaddle
  • Paddle
  • Issue
  • #6178

P
Paddle
  • 项目概览

PaddlePaddle / Paddle
大约 2 年 前同步成功

通知 2325
Star 20933
Fork 5424
  • 代码
    • 文件
    • 提交
    • 分支
    • Tags
    • 贡献者
    • 分支图
    • Diff
  • Issue 1423
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 543
  • Wiki 0
    • Wiki
  • 分析
    • 仓库
    • DevOps
  • 项目成员
  • Pages
P
Paddle
  • 项目概览
    • 项目概览
    • 详情
    • 发布
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 分支图
    • 比较
  • Issue 1,423
    • Issue 1,423
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 543
    • 合并请求 543
  • Pages
  • 分析
    • 分析
    • 仓库分析
    • DevOps
  • Wiki 0
    • Wiki
  • 成员
    • 成员
  • 收起侧边栏
  • 动态
  • 分支图
  • 创建新Issue
  • 提交
  • Issue看板
已关闭
开放中
Opened 12月 01, 2017 by saxon_zh@saxon_zhGuest

CAPI load python train 出的模型

Created by: zhglzh

merge model碰到问题,CAPI加载时直接报了异常,希望有个从python train出模型,然后使用capi加载的完整示例

*** Aborted at 1512136556 (unix time) try "date -d @1512136556" if you are using GNU date ***
PC: @                0x0 (unknown)
*** SIGSEGV (@0x60) received by PID 22477 (TID 0x7ff216ba08c0) from PID 96; stack trace: ***
    @     0x7ff215d94330 (unknown)
    @     0x7ff212921959 paddle::GradientMachine::loadParameters()
    @     0x7ff21277c123 paddle_gradient_machine_load_parameter_from_disk
    @     0x7ff216272152 adu::planning::MLPOccassionModel::load()
    @     0x7ff216272b14 adu::planning::MLPOccassionModel::MLPOccassionModel()
    @           0x419c95 adu::planning::TestSuite_occassion_model_mlp_test_Test::TestBody()
    @     0x7ff21679a6b6 testing::internal::HandleSehExceptionsInMethodIfSupported<>()
    @     0x7ff2167954dc testing::internal::HandleExceptionsInMethodIfSupported<>()
    @     0x7ff216781cad testing::Test::Run()
    @     0x7ff216782446 testing::TestInfo::Run()
    @     0x7ff216782a34 testing::TestCase::Run()
    @     0x7ff2167878ee testing::internal::UnitTestImpl::RunAllTests()
    @     0x7ff21679bc08 testing::internal::HandleSehExceptionsInMethodIfSupported<>()
    @     0x7ff216796488 testing::internal::HandleExceptionsInMethodIfSupported<>()
    @     0x7ff216786682 testing::UnitTest::Run()
    @           0x41996f main
    @     0x7ff2149f2f45 __libc_start_main
    @           0x419baf (unknown)
    @                0x0 (unknown)
Segmentation fault (core dumped)

代码如下:

def event_handler(event):
        """
        print msg
        """
        if isinstance(event, paddle.event.EndIteration):
            if event.batch_id % 100 == 0:
                print "Pass %d, Batch %d, Cost %f" % (
                    event.pass_id, event.batch_id, event.cost)

        if isinstance(event, paddle.event.EndPass):
            if event.pass_id % 1 == 0:
                param_file = 'params_pass_%d' % event.pass_id
                with gzip.open(param_file + '.tar.gz', 'w') as f:
                    trainer.save_parameter_to_tar(f)
                merge_v2_model(y_predict, param_file + '.tar.gz', param_file + '.bin')
            result = trainer.test(
                reader=paddle.batch(ds_all.create_reader(), batch_size=2),
                feeding=feeding)
            print "Test %d, Cost %f" % (event.pass_id, result.cost)
指派人
分配到
无
里程碑
无
分配里程碑
工时统计
无
截止日期
无
标识: paddlepaddle/Paddle#6178
渝ICP备2023009037号

京公网安备11010502055752号

网络110报警服务 Powered by GitLab CE v13.7
开源知识
Git 入门 Pro Git 电子书 在线学 Git
Markdown 基础入门 IT 技术知识开源图谱
帮助
使用手册 反馈建议 博客
《GitCode 隐私声明》 《GitCode 服务条款》 关于GitCode
Powered by GitLab CE v13.7