pycharm报错内容:

我的代码中是构建了一个GRU网络,在model.fit(x,y)部分出错,错误的原因应该是x和y的size不一致。
我做的预测是时间序列单步预测,且属于自回归模型。

举例说明为什么我的size设置不一致,原本应该是用本周周一到周五每天温度数据预测本周周六的温度,然后用本周周二到周六每天的温度数据预测本周周天的温度,以此类推。

假设我有一个月的数据:
那么x_train的shape=(30,5,1),y_train的shape=(30,1,1)这样是合理的。
但是由于一天24小时的温度是不同的,我现在想用本周周一到周五共5×24个小时的温度数据来预测本周周六的温度,那么此时我的x_train的shape=(30×24,5×24,1),y_train的shape不变,shape=(30,1,1),这就导致了y_train和x_train的size不同,程序报错。

结论:不确定上述设置训练集的方法是否存在可行性,但由常识来思考训练标签和训练数据应该处于同一度量单位下。

时间序列预测小白一枚,欢迎各位读者批评指正。

ValueError: Data cardinality is ambiguous: x sizes: 499001 y sizes: 2497相关推荐

  1. 关于Data cardinality is ambiguous:x sizes:y sizes: Make sure all arrays contain the same numbers

    错误代码 def load_mat(path_data,name_data,reshapeSize,dtype='float32'):dataFile = path_datadata1 = scio. ...

  2. 成功解决ValueError: Data is not binary and pos_label is not specified

    成功解决ValueError: Data is not binary and pos_label is not specified 目录 解决问题 解决思路 解决方法 解决问题 raise Value ...

  3. pyculiarity解决报错ValueError: data must be a 2 column data.frame, with thefirst column...

    解决方法 报错全称为:ValueError: data must be a 2 column data.frame, with thefirst column being a set of times ...

  4. 成功解决ValueError: Invalid classes inferred from unique values of `y`. Expected: [0 1], got [‘0‘ ‘1‘]

    成功解决ValueError: Invalid classes inferred from unique values of `y`.  Expected: [0 1], got ['0' '1'] ...

  5. pytorch:data读取出错:RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension

    在使用Dataloader读取数据的时候,使用batch_size=1不会出现这个问题.当batch_size>1时, 默认将会使用torch.stack()为你生成一个[batch,x, x, ...

  6. TypeError: strptime() takes no keyword arguments ValueError(“‘%s‘ is a bad directive in format ‘%s‘“

    t=datetime.datetime.strptime("2021/5/12 09:28:11",format="%Y/%m/%d %h:%m:%s") 1. ...

  7. 3.深度学习练习:Planar data classification with one hidden layer

    本文节选自吴恩达老师<深度学习专项课程>编程作业,在此表示感谢. 课程链接:https://www.deeplearning.ai/deep-learning-specialization ...

  8. 吴恩达深度学习(一)-第三周:Planar data classification with one hidden layer

    Planar data classification with one hidden layer 本练习会建立只有一个隐藏层的神经网络,我们将看到这与逻辑回归有多大的差别. You will lear ...

  9. Mind the GAP: A Balanced Corpus of Gendered Ambiguous Pronouns--论文笔记

    Mind the GAP: A Balanced Corpus of Gendered Ambiguous Pronouns 注意差距: 性别歧义代词的平衡语料库 Abstract Coreferen ...

最新文章

  1. Codeforces Round #Pi (Div. 2)(A,B,C,D)
  2. 零基础代码学python-零基础学python之构建web应用(入门级)
  3. 帮助理解GAN的一些补充内容
  4. Vue+Leaflet-side-by-side插件实现拉帘对比效果
  5. SCSS SASS Color 颜色函数用法
  6. vue路由跳转权限_如何在vue中实现路由跳转判断用户权限功能?
  7. php7 电子书 下载,PHP 7: Real World Application Development
  8. mysql的简单实用_MySQL的简单实用 手把手教学
  9. python安装plotly教程_python plotly 使用教程
  10. 联想笔记本linux驱动,联想为Linux驱动的计算机提供自动固件更新
  11. 文件上传利器SWFUpload入门简易教程(转)
  12. <一起JS(基础篇)>4.标识符、字符串、Number、波尔值、Null和Undefined
  13. cesium中文教程(cesium中文教程PDF)
  14. 了解talkingData
  15. 2017下半年网络工程师考试报名方式
  16. 在Mac上怎么使用Charles进行抓包
  17. 使用PY003基于外部中断+定时器的方式实现NEC红外解码
  18. word文件取消只读模式
  19. 基于android的单词记忆英语考试系统app
  20. php实现第三方登录

热门文章

  1. 封神台--第二章:遇到阻难!绕过WAF过滤!解题思路
  2. 应用之星:制作H5婚礼邀请函,让你的婚礼与众不同!
  3. 查看MDB格式文件数据表
  4. mysql服务器搭建方法_windows下搭建MySQL服务器步骤详解
  5. 7-3 一帮一 (15分)
  6. 在word中自动生成目录
  7. python实战故障诊断之CWRU数据集(五):线性判别模型及二次判别模型的应用
  8. 【Quad FPV】Betaflight S.BUS,iBUS和PPM对应的三种接收机电路
  9. dz换服务器头像不显示,Discuz头像不能显示或更换的问题及修正方法
  10. MFC的WinMain在哪呢