NotImplementedError: Wrong number or type of arguments for overloaded function 'IVector_create'.
Created by: adrianhust
data layer 报错;
def cluster_reader_cluster(base_dir, node_id):
def data_reader():
paths = os.listdir(base_dir)
for file_dir in paths:
files = os.listdir(base_dir + '/' + file_dir)
for fi in files:
with open(base_dir + '/' + file_dir + '/' + fi, "r") as f:
#with open(base_dir + '/' + file_dir + '/' + fi, "r") as f:
for line in f:
items = line.strip().split('\t')
if len(items) < 138:
continue
clk = int(items[2])
pv = int(items[1])
fea = []
idx_fea = []
url_fea = []
ideaid_fea = []
for slot_val in items[15:]:
slot, value = slot_val.split(':')
try:
value = float(value)
slot = int(slot)
except:
value = 0
if slot < 55314:
fea.append((slot, value))
elif slot >= 55314 and slot < 55317: #dim = 3
value = int(value)
idx_fea.append((slot, value))
#idx_fea.append([value])
elif slot >= 55317 and slot < 55767: #dim = 450
value = int(value)
url_fea.append((slot, value))
#url_fea.append([value])
elif slot >= 55767 and slot < 55877: #dim = 110
value = int(value)
ideaid_fea.append((slot, value))
#ideaid_fea.append([value])
#pdb.set_trace()
yield fea, idx_fea, url_fea, ideaid_fea, clk
return data_reader
data reader 返回多个字段数据,带slot 的格式是:[(slot, value)], 不带就是[(value)]
定义的input
img_input = paddle.layer.data(
name="img_input", type=paddle.data_type.sparse_vector(img_fea_dim))
idx_input = paddle.layer.data(
name="idx_input", type=paddle.data_type.integer_value_sequence(idx_fea_dim))
url_input = paddle.layer.data(
name="url_input", type=paddle.data_type.integer_value_sequence(url_fea_dim))
ideaid_input = paddle.layer.data(
name="ideaid_input", type=paddle.data_type.integer_value_sequence(ideaid_fea_dim))
label = paddle.layer.data("label", paddle.data_type.integer_value(class_dim))
feeding
feeding = {'img_input': 0, 'idx_input':1, 'url_input':2, 'ideaid_input': 3, 'label': 4}
debug 跟了一下,感觉是IndexScanner 部门报错,其他类型的都可以正常过
感觉是输入数据跟到 input 的data layer 部分出了问题
感谢!