GithubHelp home page GithubHelp logo

Comments (3)

jeffheaton avatar jeffheaton commented on September 26, 2024

I will try running it through on the latest TensorFlow and see if I can reproduce.

from t81_558_deep_learning.

blackwolf08 avatar blackwolf08 commented on September 26, 2024

When training the NN it throws this error

ValueError Traceback (most recent call last)
in ()
3 for i in tqdm(range(EPOCHS*2)):
4 generator = data_generator(train_descriptions, encoding_train, wordtoidx, max_length, number_pics_per_bath)
----> 5 caption_model.fit_generator(generator, epochs=1, steps_per_epoch=steps, verbose=1)
6
7 caption_model.optimizer.lr = 1e-4

2 frames
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training_generator.py in _get_next_batch(generator, mode)
370 raise ValueError('Output of generator should be '
371 'a tuple (x, y, sample_weight) '
--> 372 'or (x, y). Found: ' + str(generator_output))
373
374 if len(generator_output) < 1 or len(generator_output) > 3:

ValueError: Output of generator should be a tuple (x, y, sample_weight) or (x, y). Found: [[array([[0.1227757 , 0.33294907, 0.7527157 , ..., 0.21939711, 0.30216414,
0.40283215],
[0.1227757 , 0.33294907, 0.7527157 , ..., 0.21939711, 0.30216414,
0.40283215],
[0.1227757 , 0.33294907, 0.7527157 , ..., 0.21939711, 0.30216414,
0.40283215],
...,
[0.37351927, 0.24596639, 0.96352935, ..., 1.1459347 , 0.26539996,
0.01983135],
[0.37351927, 0.24596639, 0.96352935, ..., 1.1459347 , 0.26539996,
0.01983135],
[0.37351927, 0.24596639, 0.96352935, ..., 1.1459347 , 0.26539996,
0.01983135]], dtype=float32), array([[ 0, 0, 0, ..., 0, 0, 1],
[ 0, 0, 0, ..., 0, 1, 2],
[ 0, 0, 0, ..., 1, 2, 3],
...,
[ 0, 0, 0, ..., 66, 68, 3],
[ 0, 0, 0, ..., 68, 3, 21],
[ 0, 0, 0, ..., 3, 21, 61]], dtype=int32)], array([[0., 0., 1., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
...,
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.]], dtype=float32)]

from t81_558_deep_learning.

jeffheaton avatar jeffheaton commented on September 26, 2024

Thank you for the fix, it has been merged.

from t81_558_deep_learning.

Related Issues (20)

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.