Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'nb_neurons_1' (on brute.py) #10

Open
GiuseppeDiGuglielmo opened this issue Jun 27, 2019 · 2 comments
Open

KeyError: 'nb_neurons_1' (on brute.py) #10

GiuseppeDiGuglielmo opened this issue Jun 27, 2019 · 2 comments

Comments

@GiuseppeDiGuglielmo
Copy link

I am getting the following error. Am I doing anything wrong?

$ git clone [email protected]:jliphard/DeepEvolve.git
$ git log -1 --pretty=format:"%H"
e9bf389a658aacf52a1bdacf4697ae4a704c0452
$ python3 brute.py 
Using TensorFlow backend.
Traceback (most recent call last):
  File "brute.py", line 98, in <module>
    main()
  File "brute.py", line 93, in main
    genomes = generate_genome_list(all_possible_genes)
  File "brute.py", line 75, in generate_genome_list
    genome_obj.set_genes_to(genome, 0, 0)
  File "/nevis/milne/files/gd2392/research/projects/DeepEvolve/genome.py", line 102, in set_genes_to
    self.update_hash()
  File "/nevis/milne/files/gd2392/research/projects/DeepEvolve/genome.py", line 43, in update_hash
    + str(self.geneparam['nb_layers']) + self.geneparam['optimizer']
  File "/nevis/milne/files/gd2392/research/projects/DeepEvolve/genome.py", line 143, in nb_neurons
    nb_neurons[i] = self.geneparam['nb_neurons_' + str(i+1)]
KeyError: 'nb_neurons_1'
@jliphard
Copy link
Owner

No, you are not doing anything wrong. This is a bug in the code - the brute force code was broken by making the number of neurons variable for each layer, rather than using the same number of neurons per layer. The main code (main.py) runs correctly, but brute.py will need to be fixed. @gndowns or
@SaumyaTiwari01 may be able to help with this, and if not, I'll try to get to this within the next few days.

@jliphard
Copy link
Owner

If you need working code right now, then you can use the known-good code:
https://github.com/jliphard/DeepEvolve/tree/3ffc6d0b9d153206f9dda7278f3ac31217b2e406

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants