Giter Site home page Giter Site logo

keras-cnn-handwriting-mnist's Introduction

keras-cnn-handwriting-mnist's People

Contributors

luisfredgs avatar

Stargazers

Yohane Cavalcante avatar LUÍS CARLOS DE SOUZA  MENEZES avatar Flávio Márcio de Sousa avatar Asiel Aldana Ortiz avatar Alfredo Albélis avatar Rodolpho Alves avatar  avatar Israel Santiago avatar AMagar95 avatar Lucas Valentim avatar Eurismar Pires Borges avatar

Watchers

James Cloos avatar  avatar Flávio Márcio de Sousa avatar  avatar

keras-cnn-handwriting-mnist's Issues

Erro ao tentar realizar a construação do modelo

Usando o pynotebook exatamente como está tanto localmente como no Colab obtenho o erro abaixo:


ValueError Traceback (most recent call last)
in ()
5 # Um novo modelo será treinado, caso este arquivo não exista.
6 if not os.path.exists('./{}'.format(filename)):
----> 7 model.fit(x_train, y_train, validation_data=(x_test, y_test), epochs=10, batch_size=200) #dados de treino, rótulos, dados de validação e rótulos de validação, iterações (épocas)
8 model.save_weights(filename)
9 else:

/usr/local/lib/python3.6/dist-packages/keras/engine/training.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, **kwargs)
950 sample_weight=sample_weight,
951 class_weight=class_weight,
--> 952 batch_size=batch_size)
953 # Prepare validation data.
954 do_validation = False

/usr/local/lib/python3.6/dist-packages/keras/engine/training.py in _standardize_user_data(self, x, y, sample_weight, class_weight, check_array_lengths, batch_size)
787 feed_output_shapes,
788 check_batch_axis=False, # Don't enforce the batch size.
--> 789 exception_prefix='target')
790
791 # Generate sample-wise weight values given the sample_weight and

/usr/local/lib/python3.6/dist-packages/keras/engine/training_utils.py in standardize_input_data(data, names, shapes, check_batch_axis, exception_prefix)
136 ': expected ' + names[i] + ' to have shape ' +
137 str(shape) + ' but got array with shape ' +
--> 138 str(data_shape))
139 return data
140

ValueError: Error when checking target: expected predict to have shape (10,) but got array with shape (1,)

Ajuda sobre código - Conv2D

Boa tarde,
Ao tentar reproduzir o código para aprendizagem, aparece um erro relacionado a seguinte linha:
model.add(Conv2D(30, (5, 5), input_shape=(1, 28, 28), activation='relu'))
Erro
AttributeError: module 'tensorflow._api.v2.config' has no attribute 'experimental_list_devices'

Fiz pesquisas e tentei escrever conforme abaixo (também não funcionou):
model.add(Conv2D(30, (5,5), activation='relu', padding='same',input_shape=(1,28,28), data_format='channels_first'))

A única alteração que fiz foi em uma linha de código que para nova versão do tensorflow não funcionava:
Antes:
from keras import backend as K
#K.tensorflow_backend.set_image_dim_ordering('th')

Atualizei para:
from keras import backend as K
K.common.set_image_dim_ordering('th')

Poderia me ajudar?? Muito obrigada!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.