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?
You should replace
TensorFlowEstimator
withEstimator
. There has been a significant re-factor in 0.12, please have a look at theEstimator
docs.