Artificial neural network - compilation error

I am learning Deep Learning on my own and am having trouble doing ANN. That's what I'm doing:

ANN initialization (I pre-split the dataset):

classifier = Sequential()

      

Adding the input layer and the first hidden layer:

classifier.add(Dense(input_dim = 11, kernel_initializer = 'uniform', activation = 'relu', units = 6))

      

Adding a second hidden layer:

classifier.add(Dense(units = 6, kernel_initializer = 'uniform', activation = 'relu'))

      

Adding an output layer:

classifier.add(Dense(units = 1, kernel_initializer = 'uniform', activation = 'sigmoid'))

      

Compiling ANN using stochastic gradient descent:

classifier.compile(optimizer = 'adam', loss = 'binary_crossentropy', metrics = ['accuracy'])

      

After that, when I select and run the last command, I get the error:

TypeError: sigmoid_cross_entropy_with_logits() got an unexpected keyword argument 'labels'

      

I noticed that when I use it loss = mean_squared_error

, it compiles fine. Can you tell me what's going on?

Sypder

and Python

the latter, in the day when I publish it. Windows 10

... Thanos, TensorFlow and Keras recent

Thanks in advance.

+3


source to share


3 answers


Update your tensorflow version with nightly build:

https://github.com/tensorflow/tensorflow#installation



see this issue: https://github.com/carpedm20/DCGAN-tensorflow/issues/84

0


source


Tensorflow changed the keyword names for this feature and you are probably using an outdated version of tf or keras, update both and you should be good to go.



0


source


pip install -U tensorflow

fixed the problem for me

0


source







All Articles