2016-06-30 39 views
1

当运行在阿纳康达2.7本例中:阿纳康达&Tensorflow&Skflow:DNN()得到了意想不到的关键字参数 'keep_prob'

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'

Tensorflow Anaconda的使用安装:

conda install -c jjhelmus tensorflow=0.9.0 

任何想法失败了吗?

回答

2

按照repository似乎这个版本是贬值:

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. 
    """ 
相关问题