This is the ml tensorflow code I'm trying to execute -
import tensorflow.contrib.learn as skflow from sklearn import datasets, metrics iris = datasets.load_iris() classifier = skflow.TensorFlowDNNClassifier(hidden_units=[10, 20, 10], n_classes=3) classifier.fit(iris.data, iris.target) score = metrics.accuracy_score(iris.target, classifier.predict(iris.data)) print("Accuracy: %f" % score)
He gives the following error -
Traceback (last last call):
File "C: \ Users \ admin \ test3.py", line 5, in
classifier = skflow.TensorFlowDNNClassifier (hidden_units = [10, 20, 10], n_classes = 3) AttributeError: module 'tensorflow.contrib.learn' does not have the attribute 'TensorFlowDNNClassifier'
[Finished in 69.3 with exit code 1]
[shell_cmd: python -u "C: \ Users \ admin \ test3.py"]
python scikit-learn machine-learning tensorflow
siddhartha subramaniyam
source share