how can i change the code for tensorflow 0.12 version

609 views Asked by At

I have a code, which was running before but not now.

# ## Create a regressor with TF Learn
# **Parameters**:
# - model_fn: regression model
# - n_classes: 0 for regression
# - verbose
# - steps: training steps
# - optimizer: ("SGD", "Adam", "Adagrad")
# - learning_rate
# - batch_size
    regressor = learn.TensorFlowEstimator(model_fn=lstm_model(TIMESTEPS, RNN_LAYERS, DENSE_LAYERS),n_classes=0,verbose=1,steps=TRAINING_STEPS,optimizer='Adagrad',learning_rate=0.03,batch_size=BATCH_SIZE)

But now I'm getting error which says "AttributeError: 'tensorflow.contrib.learn' object has no attribute 'TensorFlowEstimator'"

How can I modify this instruction for Tensorflow 0.12?

1

There are 1 answers

1
martianwars On

You should replace TensorFlowEstimator with Estimator. There has been a significant re-factor in 0.12, please have a look at the Estimator docs.