Giter Site home page Giter Site logo

genetic-algorithm-rnn's Issues

stop at "r = algorithms.eaSimple()"

Traceback (most recent call last):
File "run.py", line 79, in
r = algorithms.eaSimple(population, toolbox, cxpb = 0.4, mutpb = 0.1, ngen = num_generations, verbose = False)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/deap/algorithms.py", line 152, in eaSimple
ind.fitness.values = fit
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/deap/base.py", line 185, in setValues
self.wvalues = tuple(map(mul, values, self.weights))
TypeError: Both weights and assigned values must be a sequence of numbers when assigning to values of <class 'deap.creator.FitnessMax'>. Currently assigning value(s) 0.076375786869707959 of <type 'numpy.float64'> to a fitness with weights (-1.0,).

Error in this line ```r = algorithms.eaSimple(population, toolbox, cxpb = 0.4, mutpb = 0.1, ngen = num_generations, verbose = False)``` while implementation in colab.

/usr/local/lib/python3.7/dist-packages/deap/creator.py:141: RuntimeWarning: A class named 'FitnessMax' has already been created and it will be overwritten. Consider deleting previous creation of that class or rename it.
RuntimeWarning)
/usr/local/lib/python3.7/dist-packages/deap/creator.py:141: RuntimeWarning: A class named 'Individual' has already been created and it will be overwritten. Consider deleting previous creation of that class or rename it.
RuntimeWarning)

Window Size: 56 , Num of Units: 7
Epoch 1/5

UnimplementedError Traceback (most recent call last)
in ()
19
20 population = toolbox.population(n = population_size)
---> 21 r = algorithms.eaSimple(population, toolbox, cxpb = 0.4, mutpb = 0.1, ngen = num_generations, verbose = False)

8 frames
/usr/local/lib/python3.7/dist-packages/tensorflow/python/eager/execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
58 ctx.ensure_initialized()
59 tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
---> 60 inputs, attrs, num_outputs)
61 except core._NotOkStatusException as e:
62 if name is not None:

UnimplementedError: Cast string to float is not supported
[[node model_3/Cast (defined at :32) ]] [Op:__inference_train_function_4464]

Function call stack:
train_function****

stop at "r = algorithms.eaSimple()"

Traceback (most recent call last):
File "run.py", line 79, in
r = algorithms.eaSimple(population, toolbox, cxpb = 0.4, mutpb = 0.1, ngen = num_generations, verbose = False)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/deap/algorithms.py", line 152, in eaSimple
ind.fitness.values = fit
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/deap/base.py", line 185, in setValues
self.wvalues = tuple(map(mul, values, self.weights))
TypeError: Both weights and assigned values must be a sequence of numbers when assigning to values of <class 'deap.creator.FitnessMax'>. Currently assigning value(s) 0.076375786869707959 of <type 'numpy.float64'> to a fitness with weights (-1.0,).

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.