Skip to content

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

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 8月 24, 2020 by saxon_zh@saxon_zhGuest

存储embedding矩阵参数出错

Created by: luolimingfighting

我的组网是这样的: sparse_input_feature_idx = fluid.layers.data(name="feature_idx", shape=[1], lod_level=1, dtype="int64") sparse_input_feature_value_float = fluid.layers.data(name="feature_value", shape=[1], lod_level=1, dtype="float32") sparse_input_emb_weight = fluid.layers.embedding( input=sparse_input_feature_idx, is_sparse=True, # you need to patch https://github.com/PaddlePaddle/Paddle/pull/14190 # if you want to set is_distributed to True is_distributed=False, size=[sparse_feature_dim, emb_size],)

#x = fluid.layers.data(name="x", shape=[max_value+1], dtype="float32") y = fluid.layers.data(name="y", shape=[1], dtype="int64") w_mat_x_with_lod = sparse_input_feature_value_float * sparse_input_emb_weight w_mat_x = fluid.layers.sequence_pool(input=w_mat_x_with_lod, pool_type='sum')

def network(input): #fc = fluid.layers.fc(input=input, size=label_index+1, act="softmax") fc = fluid.layers.softmax(input=input, axis=-1) return fc model = network(w_mat_x) cost = fluid.layers.cross_entropy(input=model, label=y) 我现在想存储上述embedding矩阵的参数,用fluid.save(main_program, save_path)保存报错: W0824 17:15:12.119884 3714 device_context.cc:252] Please NOTE: device: 0, CUDA Capability: 70, Driver API Version: 10.2, Runtime API Version: 10.0 W0824 17:15:12.125532 3714 device_context.cc:260] device: 0, cuDNN Version: 7.6. Traceback (most recent call last): File "train.py", line 149, in fluid.save(main_program, save_path) File "/opt/_internal/cpython-2.7.15-ucs4/lib/python2.7/site-packages/paddle/fluid/io.py", line 1606, in save pickle.dump(param_dict, f, protocol=2) File "/opt/_internal/cpython-2.7.15-ucs4/lib/python2.7/pickle.py", line 1376, in dump Pickler(file, protocol).dump(obj) File "/opt/_internal/cpython-2.7.15-ucs4/lib/python2.7/pickle.py", line 224, in dump self.save(obj) File "/opt/_internal/cpython-2.7.15-ucs4/lib/python2.7/pickle.py", line 286, in save f(self, obj) # Call unbound method with explicit self File "/opt/_internal/cpython-2.7.15-ucs4/lib/python2.7/pickle.py", line 655, in save_dict self._batch_setitems(obj.iteritems()) File "/opt/_internal/cpython-2.7.15-ucs4/lib/python2.7/pickle.py", line 692, in _batch_setitems save(v) File "/opt/_internal/cpython-2.7.15-ucs4/lib/python2.7/pickle.py", line 331, in save self.save_reduce(obj=obj, *rv) File "/opt/_internal/cpython-2.7.15-ucs4/lib/python2.7/pickle.py", line 425, in save_reduce save(state) File "/opt/_internal/cpython-2.7.15-ucs4/lib/python2.7/pickle.py", line 286, in save f(self, obj) # Call unbound method with explicit self File "/opt/_internal/cpython-2.7.15-ucs4/lib/python2.7/pickle.py", line 568, in save_tuple save(element) File "/opt/_internal/cpython-2.7.15-ucs4/lib/python2.7/pickle.py", line 286, in save f(self, obj) # Call unbound method with explicit self File "/opt/_internal/cpython-2.7.15-ucs4/lib/python2.7/pickle.py", line 492, in save_string self.write(BINSTRING + pack("<i", n) + obj) struct.error: 'i' format requires -2147483648 <= number <= 2147483647 照理说embedding矩阵的参数不应该超过这个范围吧,麻烦帮忙看看是哪里出问题了。

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