cannot feed value #980
Unanswered
island-polyu
asked this question in
Q&A
Replies: 1 comment
-
You should build a network with 8 input neurons |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Cannot feed value of shape (1000, 8) for Tensor Placeholder_10:0, which has shape (None, 1)
I just want to change the example data, but there is aomething wrong.
My code is:
import pandas as pd
import numpy as np
import deepxde as dde
path1=r'E:/'
dataset=pd.read_excel(path1+'dataset3.xlsx')
X_train = dataset.iloc[:1000,2:10]
y_train = dataset.iloc[:1000,11]
X_test = dataset.iloc[1000:1200,2:10]
y_test = dataset.iloc[1000:1200,11]
data = dde.data.DataSet(
X_train=X_train,
y_train=y_train,
X_test=X_test,
y_test=y_test,
standardize=True,
)
layer_size = [1] + [50] * 3 + [1]
activation = "tanh"
initializer = "Glorot normal"
net = dde.nn.FNN(layer_size, activation, initializer)
model = dde.Model(data, net)
model.compile("adam", lr=0.001, metrics=["l2 relative error"])
losshistory, train_state = model.train(iterations=50000)# the mistake happens here
dde.saveplot(losshistory, train_state, issave=True, isplot=True)
Beta Was this translation helpful? Give feedback.
All reactions