Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AttributeError: module 'tensorflow.python.estimator.estimator_lib' has no attribute 'LinearRegressor'

import tensorflow as tf
import numpy as np
feature_columns = [tf.feature_column.numeric_column("x", shape=[1])]
estimator = tf.estimator.LinearRegressor(feature_columns=feature_columns)

My code is above. Then it shows the error

"AttributeError: module 'tensorflow.python.estimator.estimator_lib' has no attribute 'LinearRegressor'"

Python 3.5.2

like image 455
CelineLi Avatar asked Aug 22 '17 12:08

CelineLi


1 Answers

Might be you are using older tensorflow version, as tf.estimator.LinearRegressor included with tensorflow=1.3.0.

upgrade your tensorflow installation

pip install --upgrade tensorflow==1.3.0
like image 59
Ishant Mrinal Avatar answered Nov 01 '22 22:11

Ishant Mrinal