当前位置:网站首页>Multivariable time series prediction using LSTM -- problem summary
Multivariable time series prediction using LSTM -- problem summary
2022-07-26 21:11:00 【Three feed tree house】
Rigid contact LSTM, Reference resources Use LSTM Carry out multivariable time series prediction This article , Write very well , But there are many problems when running , May be tensorflow Version issue for , There are various problems when running , I changed it for a while this morning , Finally, I got through , There are also many bloggers with similar problems under this blog , Let's record it here , I hope it helps .
My package version information
python3.7
keras2.3.1
tensorflow2.2.0
ps: The original title is also used tensorflow+keras, although tensorflow2.X When to bring it keras, But I did it again keras!
problem 1
grid_search.fit(trainX,trainY) Report errors ,Cannot clone object <tensorflow.python.keras.wrappers.scikit_learn.KerasRegressor object at 0x7fc38c260f70>, as the constructor either does not set or modifies parameter validation_data
This problem , hold grid_model = KerasRegresso r(build_fn=build_model, verbose=1, validation_data=(testX,testY))
there validation_data=(testX,testY) Move to below grid_search.fit(trainX,trainY) in , The changed code is :
def build_model(optimizer):
grid_model = Sequential()
grid_model.add(LSTM(50,return_sequences=True,input_shape=(30,5)))
grid_model.add(LSTM(50))
grid_model.add(Dropout(0.2))
grid_model.add(Dense(1))
grid_model.compile(loss = 'mse',optimizer = optimizer)
return grid_model
grid_model = KerasRegressor(build_fn=build_model,verbose=1)
parameters = {
'batch_size' : [16,20],
'epochs' : [8,10],
'optimizer' : ['adam','Adadelta'] }
grid_search = GridSearchCV(estimator = grid_model,
param_grid = parameters,
cv = 2)
grid_search = grid_search.fit(trainX,trainY,validation_data=(testX,testY))
There should be no big problems after the change here ,
problem 1.5
This is not a problem , Just look at the comment area and say that the program keeps running , It won't stop , This is actually looking for the optimal parameters in a loop , About a dozen rounds stopped
The following possible problems ,( Additional problems I encountered
problem 2
Cannot convert a symbolic Tensor (lstm/strided_slice:0) to a numpy array.
This is numpy The version does not correspond to the problem , Use 1.19.2 Just the version
pip install -U numpy==1.19.2
problem 3
TypeError: Descriptors cannot not be created directly
Downgrade protobuf that will do
pip install 'protobuf~=3.19.0'
It will probably be solved here , If you have other questions, welcome to the message area to discuss .
边栏推荐
- 08_ue4进阶_开始结束暂停菜单等ui
- 创建一个自身类的静态对象变量,究竟会如何执行?
- Shell综合应用案例,归档文件
- 09_ UE4 advanced_ Enter the next level and reserve the blood volume
- Shell函数、系统函数、basename [string / pathname] [suffix] 可以理解为取路径里的文件名称 、dirname 文件绝对路径、自定义函数
- DevSecOps,让速度和安全兼顾
- [Oracle training] - deploy Ogg known as zero downtime migration
- How to upload and download files
- LCP 11. Statistics of expected number
- 2022 pole technology communication - anmou technology opens a new chapter of commercialization
猜你喜欢

LeetCode链表问题——19.删除链表的倒数第N个节点(一题一文学会链表)

每日练习------有一组学员的成绩,将它们按降序排列,要增加一个学员的成绩,将它插入成绩序列,并保持降序

PLSQL package

Buu brush inscription 3

Shell comprehensive application cases, archive files

PointPillars: Fast Encoders for Object Detection from Point Clouds 阅读笔记

JDBC connection

今天公司碰到一个阿里p8,算是真正见识到了基础的天花板

Shell综合应用案例,归档文件

2022开放原子全球开源峰会议程速递 | 7 月 27 日分论坛议程一览
随机推荐
Use Baidu PaddlePaddle easydl to complete garbage classification
Go+mysql+redis+vue3 simple chat room, the sixth bullet: use vue3 and element plus to call the interface
我们被一个 kong 的性能 bug 折腾了一个通宵
What is the function of the serializable interface?
LCP 11. Statistics of expected number
Shell function, system function, basename [string / pathname] [suffix] can be understood as taking the file name in the path, dirname file absolute path, and user-defined function
Soft test --- database (1) database foundation
QT基础第一天 (1)QT,GUI(图形用户接口)开发
What kind of security problems will the server encounter?
Devsecops, speed and security
Deployment of kubernetes
【MySQL系列】-索引知多少
[pytoch foundation] torch.stack() function analysis
6种方法帮你搞定SimpleDateFormat类不是线程安全的问题
详解西部数据SMR叠瓦式硬盘的190二级编译器(译码表)模块
【问题篇】浏览器get请求带token
立即报名:7 月 29 日推荐系统峰会 2022
如何借助自动化工具落地DevOps|含低代码与DevOps应用实践
Increased uncertainty in BTC and eth due to the approaching interest rate hike? The US economy will face more pain
Auto. JS rotation Icon