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

NullPointerException after running ObjectiveMarioCPPNtoGAN.bat #2

Open
CIGbalance opened this issue Jan 9, 2020 · 3 comments
Open

Comments

@CIGbalance
Copy link
Collaborator

After running ObjectiveMarioCPPNtoGAN.bat, I get the following:

[81.0][2944.0, 1.005464480874317, 22.0, 80.0]
Module Usage: [6]
Individual: 48
	Fitness scores:
	ProgressPlusJumps:	[81.0]:81.0 +/- NaN
	Other scores:
	Distance:	[2944.0]:2944.0 +/- NaN
	PercentDistance:	[1.005464480874317]:1.005464480874317 +/- NaN
	Time:	[22.0]:22.0 +/- NaN
	Jumps:	[80.0]:80.0 +/- NaN
Fitness:[81.0]
OtherScores:[2944.0, 1.005464480874317, 22.0, 80.0]

Saved object to mariocppntogan/Test0/bestObjectives/gen4_bestIn0.xml
Done parents: 0 minutes
Eval children: 
innovation 6 not found in net 60
innovation -30 not found in net 60
No nodes are both connected and alterable!
There should be unfrozen outputs
Outputs: 0

java.lang.NullPointerException
	at edu.southwestern.evolution.genotypes.TWEANNGenotype.getRandomAlterableConnectedNodeInnovationNumber(TWEANNGenotype.java:1111)
	at edu.southwestern.evolution.genotypes.TWEANNGenotype.linkMutation(TWEANNGenotype.java:1032)
	at edu.southwestern.evolution.genotypes.TWEANNGenotype.linkMutation(TWEANNGenotype.java:1021)
	at edu.southwestern.evolution.mutation.tweann.NewLinkMutation.mutate(NewLinkMutation.java:31)
	at edu.southwestern.evolution.mutation.Mutation.go(Mutation.java:29)
	at edu.southwestern.evolution.genotypes.TWEANNGenotype.mutate(TWEANNGenotype.java:714)
	at edu.southwestern.evolution.nsga2.NSGA2.generateNSGA2Children(NSGA2.java:159)
	at edu.southwestern.evolution.nsga2.NSGA2.generateChildren(NSGA2.java:81)
	at edu.southwestern.evolution.mulambda.MuLambda.processChildren(MuLambda.java:216)
	at edu.southwestern.evolution.mulambda.MuLambda.getNextGeneration(MuLambda.java:345)
	at edu.southwestern.experiment.evolution.SinglePopulationGenerationalEAExperiment.run(SinglePopulationGenerationalEAExperiment.java:215)
	at edu.southwestern.MMNEAT.MMNEAT.run(MMNEAT.java:414)
	at edu.southwestern.MMNEAT.MMNEAT.evolutionaryRun(MMNEAT.java:571)
	at edu.southwestern.MMNEAT.MMNEAT.main(MMNEAT.java:542)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Traceback (most recent call last):
  File "./python/GAN/generator_ws.py", line 138, in <module>
    lv = numpy.array(json.loads(line))
  File "/usr/lib/python3.5/json/__init__.py", line 319, in loads

Is that normal?

@CIGbalance
Copy link
Collaborator Author

This was on Branch CCPNtoGAN, but I assume it is probably also on master.

@schrum2
Copy link
Owner

schrum2 commented Jan 9, 2020

Ideally this would never happen, but hopefully this error is only occurring in a circumstance that we can avoid.

The first time you launch the file, it makes a directory mariocppntogan\Test0 to store results. If you terminate and run the file again, it attempts to resume in mariocppntogan\Test0 from where it left off. I think this resume process is imperfect. It's better to start each run fresh by deleting Test0.

If you want to launch a new run (with a different random seed) then change both the runNumber and the randomSeed in the batch file.

If you find that this error is reproducible, then please give me details as to how.

@CIGbalance
Copy link
Collaborator Author

I think the main issue is that I was not aware that I was restarting the run and that I had to delete the folder. So we just need to make that clearer / make the batch file create a new directory as appropriate.

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