Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Want to execute for cpu4.csv of Donut dataset #18

Open
dguhanus opened this issue Oct 21, 2019 · 4 comments
Open

Want to execute for cpu4.csv of Donut dataset #18

dguhanus opened this issue Oct 21, 2019 · 4 comments

Comments

@dguhanus
Copy link

Hi Haowen Xu,
I am trying to run the Donut sample dataset cpu4.csv
I have done these following things for invoking cpu4.csv

df = pd.read_csv("sample_data/cpu4.csv")
timestamp, values, labels = df.timestamp, df.value, df.label
import tensorflow as tf
from donut import Donut
from tensorflow import keras as K
from tfsnippet.modules import Sequential

We build the entire model within the scope of model_vs,

it should hold exactly all the variables of model, including

the variables created by Keras layers.

with tf.variable_scope('model') as model_vs:
model = Donut(
h_for_p_x=Sequential([
K.layers.Dense(100, kernel_regularizer=K.regularizers.l2(0.001),
activation=tf.nn.relu),
K.layers.Dense(100, kernel_regularizer=K.regularizers.l2(0.001),
activation=tf.nn.relu),
]),
h_for_q_z=Sequential([
K.layers.Dense(100, kernel_regularizer=K.regularizers.l2(0.001),
activation=tf.nn.relu),
K.layers.Dense(100, kernel_regularizer=K.regularizers.l2(0.001),
activation=tf.nn.relu),
]),
x_dims=120,
z_dims=5,
)

'''
Training of Donut model
'''
from donut import DonutTrainer, DonutPredictor

trainer = DonutTrainer(model=model, model_vs=model_vs)
predictor = DonutPredictor(model)

with tf.Session().as_default():
trainer.fit(train_values, train_labels, train_missing, mean, std)
test_score = predictor.get_score(test_values, test_missing)

I am not able to understand how to set input_x and input_y
I am getting this error message:
FailedPreconditionError: Error while reading resource variable model/sequential_1/forward/_1/dense_3/bias from Container: localhost. This could mean that the variable was uninitialized. Not found: Container localhost does not exist. (Could not find resource: localhost/model/sequential_1/forward/_1/dense_3/bias)

@obouluh
Copy link

obouluh commented Mar 23, 2020

add param about

df = pd.read_csv("sample_data/cpu4.csv")
just like
df = pd.read_csv(r"path", header='infer'....)

@backhamburger
Copy link

hi, dguhanus:

Have you solved this problem? I meet the same FailedPreconditionError right now.
Thank you sincerely.

@qpan7777
Copy link

qpan7777 commented Dec 2, 2020 via email

@dguhanus
Copy link
Author

dguhanus commented Dec 3, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants