0

I am trying to import skflow on my Windows PC. I have already install and used Anaconda on Python (3.5). I have no trouble to use tensorflow but when I want to use skflow I get the error:

ImportError                               Traceback (most recent call last)
<ipython-input-1-04faecc7c0de> in <module>()
      8 import tensorflow as tf
      9 from tensorflow.contrib import learn
---> 10 from tensorflow.contrib import skflow

ImportError: cannot import name 'skflow'

Does anyone know how to fix this?

Thanks in advance!

H35am
  • 768
  • 2
  • 12
  • 32

1 Answers1

4

Please try this:

>>> import tensorflow as tf
>>> from tensorflow.contrib import learn as skflow

FYI, skflow is not any special package/module/... It's an alias for tensorflow.contrib.learn which is in 'sklearn' style.

Hng
  • 148
  • 4
  • Thanks for your response, unfortunately this answer is not correct, as for your suggestion about skyflow being an alias, I don't think it's correct. FYI, I'm stuck on this tutorial: https://blog.socialcops.com/engineering/machine-learning-python/ these are the parts that are not working: import tensorflow as tf from tensorflow.contrib import skflow tf_clf_dnn = skflow.TensorFlowDNNClassifier(hidden_units=[20, 40, 20], n_classes=2, batch_size=256, steps=1000, learning_rate=0.05) tf_clf_dnn.fit(X_train, y_train) tf_clf_dnn.score(X_test, y_test) – H35am Jan 14 '17 at 22:00
  • 1
    That blog was posted in July'16. TensorFlow has changed since then, please refer [link](https://www.tensorflow.org/versions/r0.11/tutorials/tflearn/). You are missing 'feature_columns' argument while initializing the classifier. – Hng Jan 15 '17 at 10:02
  • 2
    `>>> from tensorflow.contrib import learn as skflow; help(skflow.DNNClassifier.__init__)` – Hng Jan 15 '17 at 10:07
  • 1
    help(skflow.DNNClassifier.__init__) this helped me very well. It seems that also the init parameters are changed, "batch_size=256, steps=1000, learning_rate=0.05" these are not accepted anymore. Anyway reason that I choose to follow that tutorial is that I thought is a recent article, I didn't know that it will change so fast. – H35am Jan 15 '17 at 15:45