Skip to content

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

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 11月 07, 2016 by saxon_zh@saxon_zhGuest

python预测时CreateSparseMatrix出 core

Created by: 20092136

以下是我使用 python 版本预测模块的方式:

from py_paddle import swig_paddle, DataProviderConverter
from paddle.trainer.PyDataProvider2 import *
from paddle.trainer.config_parser import *
                                        
def load_test_data():                   
    test_data = []                      
    with open('./test/sentiment/thirdparty/predictset.txt', 'r') as f:
        for line in f:                  
            arr = line.strip().split('\t')
            label = arr[0]              
            seq = arr[1].split()        
            feat = arr[2].split()       
            test_data.append([map(int, seq), map(int, feat), int(label)])
            print test_data             
            return test_data            
    return test_data                    
                                        
def main():                             
    swig_paddle.initPaddle("--use_gpu=0")                                    
    conf = parse_config("./model_output/pass-00000/trainer_config.py", "") 
    network = swig_paddle.GradientMachine.createFromConfigProto(conf.model_config)
    assert isinstance(network, swig_paddle.GradientMachine)  # For code hint.
    network.loadParameters("./model_output/pass-00000/")
                                        
    converter = DataProviderConverter([integer_value_sequence(319085),
        sparse_non_value_slot(6121), integer_value(888)])
    TEST_DATA = load_test_data()        
    inArg = converter.convert(TEST_DATA)

其中TEST_DATA的一个 sample 以及错误信息如下打印所示:

I1107 11:40:57.545857 2794 Util.cpp:144] commandline: --use_gpu=0 I1107 11:40:57.545934 2794 Util.cpp:113] Calling runInitFunctions I1107 11:40:57.546272 2794 Util.cpp:126] Call runInitFunctions done. [WARNING 2016-11-07 11:40:57,588 default_decorators.py:40] please use keyword arguments in paddle config. [WARNING 2016-11-07 11:40:57,590 default_decorators.py:40] please use keyword arguments in paddle config. [INFO 2016-11-07 11:40:57,595 networks.py:1122] The input order is [seq, feat] [INFO 2016-11-07 11:40:57,595 networks.py:1129] The output order is [fc_ly_4] I1107 11:40:57.912839 2794 GradientMachine.cpp:123] Loading parameters from ./model_output/pass-00000/ [[[290, 2201, 554, 37, 142, 237, 78, 60, 171, 1483, 1615, 2201, 229, 237, 50, 9, 18, 0, 2238, 204, 7, 2785, 15, 131, 2, 53, 79, 173, 52, 30, 345, 752, 110, 81, 690, 483, 2432, 2201, 19, 483, 1732, 125, 1483, 483, 55, 3909, 125, 1483, 86, 181, 695, 415, 14, 3, 22476, 370, 173, 242, 3], [494, 1333, 737, 3421, 1030, 6105], 206]] F1107 11:40:57.991053 2794 CpuSparseMatrix.cpp:59] Check failed: newNnz <= newHeight * newWidth (6 vs. 0)

* Check failure stack trace: *

@ 0x7f3c8f1c8448 google::LogMessage::Fail() @ 0x7f3c8f1c83a0 google::LogMessage::SendToLog() @ 0x7f3c8f1c7e35 google::LogMessage::Flush() @ 0x7f3c8f1cabf6 google::LogMessageFatal::~LogMessageFatal() @ 0x7f3c8ede308a paddle::CpuSparseMatrix::resize() @ 0x7f3c8ede314f paddle::CpuSparseMatrix::CpuSparseMatrix() @ 0x7f3c8edf53ae paddle::Matrix::createSparseMatrix() @ 0x7f3c8ed6920e Matrix::createSparse() @ 0x7f3c8ed3bc8d _wrap_Matrix_createSparse @ 0x4b4cb9 PyEval_EvalFrameEx @ 0x4b6b28 PyEval_EvalCodeEx @ 0x4b5d10 PyEval_EvalFrameEx @ 0x4b5fb8 PyEval_EvalFrameEx @ 0x4b6b28 PyEval_EvalCodeEx @ 0x4b5d10 PyEval_EvalFrameEx @ 0x4b5fb8 PyEval_EvalFrameEx @ 0x4b6b28 PyEval_EvalCodeEx @ 0x4b6c52 PyEval_EvalCode @ 0x4e1c7d PyRun_FileExFlags @ 0x4e3501 PyRun_SimpleFileExFlags @ 0x4159dd Py_Main @ 0x7f3c92c9fbd5 __libc_start_main @ 0x414b71 (unknown) predict.sh: line 5: 2794 Aborted (core dumped) ./python27-gcc482/bin/python predict.py

追查 源码至py_paddle.dataprovider_converter.SparseBinaryScanner.finish_scan中创建 SparseMatrix出错,请问有可能是什么原因?

指派人
分配到
无
里程碑
无
分配里程碑
工时统计
无
截止日期
无
标识: paddlepaddle/Paddle#368
渝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