在Anaconda 2.7中运行此示例时:
import tensorflow.contrib.learn as skflow
def DNN_model(X, y):
"""This is DNN with 50, 20, 10 hidden layers, and dropout of 0.5 probability."""
layers = skflow.ops.dnn(X, [50, 30, 10], keep_prob=0.5)
return skflow.models.logistic_regression(layers, y)
clf = skflow.TensorFlowEstimator(model_fn=DNN_model, n_classes=3)它转储了以下问题:
dnn()得到一个意外的关键字参数'keep_prob‘
Anaconda的Tensorflow安装时使用:
conda install -c jjhelmus tensorflow=0.9.0知道什么失败了吗?
发布于 2016-06-30 10:40:16
根据存储库的说法,这个版本似乎已经贬值了:
learn.ops.dnn is deprecated,please use contrib.layers.dnn.
然而,应通过不同的论点:
def dnn(tensor_in, hidden_units, activation=nn.relu, dropout=None):
"""Creates fully connected deep neural network subgraph.
This is deprecated. Please use contrib.layers.dnn instead.
Args:
tensor_in: tensor or placeholder for input features.
hidden_units: list of counts of hidden units in each layer.
activation: activation function between layers. Can be None.
dropout: if not None, will add a dropout layer with given probability.
Returns:
A tensor which would be a deep neural network.
"""https://stackoverflow.com/questions/38120008
复制相似问题