2016-06-30 104 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. 
    """ 
相關問題