Skip to content

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

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

多目标学习的时候出现out[j] > 0 && out[j] < 1.0错误

Created by: michael200892458

出错信息: I1111 17:21:29.127272 3751 TrainerInternal.cpp:162] Batch=20 samples=2464 AvgCost=0.0870727 CurrentCost=0.0870727 Eval: classification_error_evaluator=0.00745739 CurrentEval: classification_error_evaluator=0.00745739 I1111 17:21:29.127521 3751 TrainerInternal.cpp:179] Pass=7 Batch=20 samples=2464 AvgCost=0.0870727 Eval: classification_error_evaluator=0.00745739 I1111 17:21:29.190271 3751 Tester.cpp:111] Test samples=300 cost=0.455414 Eval: classification_error_evaluator=0.0183333 I1111 17:21:29.190448 3751 GradientMachine.cpp:112] Saving parameters to ./output/pass-00007 I1111 17:21:29.195664 3751 Util.cpp:213] copy trainer_config.py to ./output/pass-00007 ............F1111 17:21:30.308898 3754 Matrix.cpp:3483] Check failed: out[j] > 0 && out[j] < 1.0 *** Check failure stack trace: *** @ 0x7f25996666ed google::LogMessage::Fail() @ 0x7f259966ae50 google::LogMessage::SendToLog() @ 0x7f2599667217 google::LogMessage::Flush() @ 0x7f2599667476 google::LogMessageFatal::~LogMessageFatal() @ 0x783f0e paddle::CpuMatrix::multiBinaryLabelCrossEntropy() @ 0x64c735 paddle::CostLayer::forward() @ 0x5aa50e paddle::NeuralNetwork::forward() @ 0x59ed27 paddle::TrainerThread::forward() @ 0x5a0bac paddle::TrainerThread::computeThread() @ 0x7f25992e62f0 execute_native_thread_routine @ 0x3f0b90610a (unknown) @ 0x3f0b0c5ee3 (unknown)

trainer_config.py from paddle.trainer_config_helpers import *

dict_file = "./data/dict.txt" word_dict = dict() with open(dict_file, 'r') as f: for i, line in enumerate(f): w = line.strip().split()[0] word_dict[w] = i

trn = 'data/train.list' tst = 'data/test.list' process = 'process' define_py_data_sources2(train_list=trn, test_list=tst, module="dataprovider", obj=process, args={"dictionary": word_dict})

batch_size = 128 settings( batch_size=batch_size, learning_rate=2e-3, learning_method=AdamOptimizer(), regularization=L2Regularization(8e-4), gradient_clipping_threshold=25 )

data = data_layer(name="word", size=len(word_dict)) embedding = embedding_layer(input=data, size=128) conv = sequence_conv_pool(input=embedding, context_len=5, hidden_size=512) output = fc_layer(input=conv, size=8, act=SoftmaxActivation())

label = data_layer(name="label", size=8) cls = classification_cost(input=output, label=label, cost='multi_binary_label_cross_entropy') outputs(cls)

dataprovider.py from paddle.trainer.PyDataProvider2 import * UNK_IDX = 0

def initializer(settings, dictionary, **kwargs): settings.word_dict = dictionary settings.input_types = [ integer_value_sequence(len(dictionary)), sparse_binary_vector(8)]

@provider(init_hook=initializer, cache=CacheType.CACHE_PASS_IN_MEM) def process(settings, file_name): n = 0 with open(file_name, 'r') as f: for line in f: fields = line.strip().split('\t') if len(fields) < 5: continue ticketId = fields[0] labelStr = fields[3] labels = [] try: tokens = labelStr.split(',') for token in tokens: value = int(token) labels.append(value) except ValueError: continue

        words = fields[2]
        words = words.split(" ");
        word_slot = [settings.word_dict.get(w, UNK_IDX) for w in words]
        n += 1
        if n <= 2:
            print [word_slot, labels]
        yield word_slot, labels
print "process end, n:%d" % n
指派人
分配到
无
里程碑
无
分配里程碑
工时统计
无
截止日期
无
标识: paddlepaddle/Paddle#447
渝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