使用预测工具预测sparse_binary_vector的instance时候出错
Created by: linrongyi
使用预测工具预测sparse_binary_vector的instance, 执行network.forwardTest(in_arg) 出错
代码
# -*- coding: utf-8 -*-
import sys
import numpy as np
from py_paddle import swig_paddle
from py_paddle import DataProviderConverter
from paddle.trainer.PyDataProvider2 import *
#from paddle.trainer.PyDataProviderWrapper import DenseSlot, IndexSlot
from paddle.trainer.config_parser import parse_config
swig_paddle.initPaddle("--use_gpu=0")
def get_slots():
slots = [sparse_binary_vector(800000)]
for i in xrange(8):
slots.append(sparse_binary_vector(800000))
slots.append(sparse_binary_vector(800000))
return slots
slots = get_slots()
conf = parse_config("./output/pass-00000/predictor_config.conf", "")
network = swig_paddle.GradientMachine.createFromConfigProto(conf.model_config)
converter = DataProviderConverter(slots)
instance_ = [[1]] * 17
in_arg = converter([instance_])
network.forwardTest(in_arg)
错误提示
I1105 20:46:14.398023 11953 Util.cpp:155] commandline: --use_gpu=0
I1105 20:46:14.398080 11953 Util.cpp:130] Calling runInitFunctions
I1105 20:46:14.398355 11953 Util.cpp:143] Call runInitFunctions done.
F1105 20:46:14.660048 11953 SparseRowMatrix.h:63] Check failed: globalIndices_[row] != kUnusedId_ (4294967295 vs. 4294967295)
*** Check failure stack trace: ***
@ 0x7f45a5946a3d google::LogMessage::Fail()
@ 0x7f45a594aed7 google::LogMessage::SendToLog()
@ 0x7f45a5948d39 google::LogMessage::Flush()
@ 0x7f45a594903d google::LogMessageFatal::~LogMessageFatal()
@ 0x7f45a725eea2 paddle::CpuMatrix::mul<>()
@ 0x7f45a7256237 paddle::CpuMatrix::mul()
@ 0x7f45a70e716e paddle::FullyConnectedLayer::forward()
@ 0x7f45a70aad64 paddle::NeuralNetwork::forward()
@ 0x7f45a701d955 _wrap_GradientMachine_forward
@ 0x7f45b2e273a3 PyEval_EvalFrameEx
@ 0x7f45b2e29130 PyEval_EvalCodeEx
@ 0x7f45b2e274a1 PyEval_EvalFrameEx
@ 0x7f45b2e29130 PyEval_EvalCodeEx
@ 0x7f45b2e274a1 PyEval_EvalFrameEx
@ 0x7f45b2e29130 PyEval_EvalCodeEx
@ 0x7f45b2e29242 PyEval_EvalCode
@ 0x7f45b2e4362c run_mod
@ 0x7f45b2e43700 PyRun_FileExFlags
@ 0x7f45b2e44c0c PyRun_SimpleFileExFlags
@ 0x7f45b2e564cc Py_Main
@ 0x318ae1ecdd (unknown)
Thread [139937329645312] Forwarding query_vec, site7, title7, site6, title6, site5, title5, site4, title4, site3, title3, site2, title2, site1, title1, site0, title0, query,
*** Aborted at 1478349974 (unix time) try "date -d @1478349974" if you are using GNU date ***
PC: @ 0x318ae328a5 (unknown)
*** SIGABRT (@0x1f500002eb1) received by PID 11953 (TID 0x7f45b2d30700) from PID 11953; stack trace: ***
@ 0x318b20f500 (unknown)
@ 0x318ae328a5 (unknown)
@ 0x318ae34085 (unknown)
@ 0x7f45a5953246 google::FindSymbol()
版本号, 93e4d0cc.
麻烦 @reyoung 看一下?