lis-epfl / robogen

RoboGen - Robot generation through artificial evolution
http://www.robogen.org
GNU General Public License v3.0
27 stars 16 forks source link

Segmentation fault while evolving brain #26

Closed Mikaz-fr closed 11 years ago

Mikaz-fr commented 11 years ago

Hi

I ran the client-server without issues for several different evolutions. But yesterday I changed some parameters and now I always got a segmentation fault of the client after the first generation: Segmentation fault (core dumped)

I use a population of 100 and 5 starting points. You can find a log of the server side (with valgrind) here: https://gist.github.com/Mikaz-fr/f52f14011ed65ecb2d16 (only for the first individual since it take forever to run with valgrind).

And here is the config I use:

conf.txt

scenario=chasing
timeStep=0.01
nTimeSteps=9000
terrainType=flat
terrainLength=4
terrainWidth=4
obstaclesConfigFile=../../work_dir/obstacles.txt
startPositionConfigFile=../../work_dir/startPos.txt

startpos.txt

0.6 0.1
-1.4    -0.1
0.4 -1.1
1.5 1.1
-1.35   0.9

obstacles.txt

0.5 -0.5    0.2 0.2 0.3
0.2 0.5 0.3 0.2 0.3
-0.7    -0.65   0.2 0.3 0.3
-0.5    0.9 0.2 0.2 0.3
-1  -0.1    0.2 0.4 0.3

BrainEvolveParam.in

### GENERAL ########################################################################
# --help=0                                 # -h : Prints this message
# --stopOnUnknownParam=1                   # Stop if unkown param entered
# --serverIpAddress=127.0.0.1              # IP Address of the simulator server
# --tcpPortNumber=8001                     # Port number for the TCP socket communication with the simulator server
--experimentConfigFile=../../work_dir/conf.txt          # Experiment Configuration Filename
--robotGenotypeFile=../../work_dir/RealRobot.txt            # Robot Genotype Text Description Filename
--sensorFailureProb=0                    # Probability of sensor failure
--actuatorFailureProb=0                  # Probability of actuator failure
--evaluationTrialsCount=1                # Number of (simulation) trials to perform for one fitness request
--neuralConnectionMinWeight=-1.0            # Minimum value for the weights of the robot brain's neural connections
--neuralConnectionMaxWeight=1.0            # Maximum value for the weights of the robot brain's neural connections
--hypercubeXoverAlpha=0.01                  # Alpha value for Hypercube crossover of brain weights
--brainGaussianMutSigma=0.25              # Sigma value for Gaussian mutation of brain weights
--mutPrBrainBiasWt=0.33                   # Mutation probability per brain bias weight
--mutPrBrainConnWt=0.02                   # Mutation probability per brain connection weight
# --seed=1367506931                        # -S : Random number seed

### EVOLUTION ENGINE ###############################################################
--popSize=100                             # -P : Population Size
--selection=Roulette                   # -S : Selection: DetTour(T), StochTour(t), Roulette, Ranking(p,e) or Sequential(ordered/unordered)
--nbOffspring=100%                       # -O : Nb of offspring (percentage or absolute)
--replacement=Comma                      # -R : Replacement: Comma, Plus or EPTour(T), SSGAWorst, SSGADet(T), SSGAStoch(t)
--weakElitism=1                          # -w : Old best parent replaces new worst offspring *if necessary*

### MY APPLICATION #################################################################
# --coutRobogenStat=0                      # Prints my stat to screen, one line per generation
 --fileRobogenStat=1                      # Saves my stat to file (in resDir
 --plotRobogenStat=1                      # On-line plots my stat using gnuplot

### OUTPUT #########################################################################
# --useEval=1                              # Use nb of eval. as counter (vs nb of gen.)
 --useTime=1                              # Display time (s) every generation
 --printBestStat=1                        # Print Best/avg/stdev every gen.
# --printPop=0                             # Print sorted pop. every gen.

### OUTPUT - DISK ##################################################################
--resDir=../../work_dir/Res                             # Directory to store DISK outputs
--eraseDir=1                             # erase files in dirName if any
--fileBestStat=1                         # Output bes/avg/std to file

### OUTPUT - GRAPHICAL #############################################################
 --plotBestStat=1                         # Plot Best/avg Stat
 --plotHisto=1                            # Plot histogram of fitnesses

### PERSISTENCE ####################################################################
#--Load=                                  # -L : A save file to restart from
# --recomputeFitness=0                     # -r : Recompute the fitness after re-loading the pop.?
--saveFrequency=1                        # Save every F generation (0 = only final state, absent = never)
#--saveTimeInterval=120                     # Save every T seconds (0 or absent = never)
# --status=./Robogen-EA-BrainEvolver-Client.status # Status file

### STOPPING CRITERION #############################################################
--maxGen=150                            # -G : Maximum number of generations () = none)
# --steadyGen=100                          # -s : Number of generations with no improvement
--minGen=0                               # -g : Minimum number of generations
# --maxEval=0                              # -E : Maximum number of evaluations (0 = none)
# --targetFitness=0                        # -T : Stop when fitness reaches
# --CtrlC=0                                # -C : Terminate current generation upon Ctrl C
# --monitor-with-CtrlC=0                   # Monitor current generation upon Ctrl C

### VARIATION OPERATORS ############################################################
--pCross=0.65                             # -C : Probability of Crossover
--pMut=0.1                               # -M : Probability of Mutation

Any idea what's wrong?

prfernando commented 11 years ago

Does the Robogen-EA-BrainEvolver-Client report SEGFAULT? If so, send me your input files - conf.txt, robotGenotype.txt, startPos.txt, obstacles.txt, and the Robogen-EA-BrainEvolver-Client.status files. Also, send me the last population saved before the crash and the curRobot.dat files. Please zip all of them and send them to me. Also, it would be of more help if you could run the executables in Debug mode and figure out which function is reporting the SEGFAULT. Finally, what were the parameter changes you made?

Mikaz-fr commented 11 years ago

Yes the client report the segfault. You can get the config file from here: https://dl.dropboxusercontent.com/u/1703878/seg_fault.zip There is not yet the last population and curRobot since I relaunched the evolution and I thus lost it. As soon as it crash again I'll upload it then I'll try with debug mode.

I changed:

--popSize=70    =>    --popSize=100
--selection=DetTour(2)    =>    --selection=Roulette                 

--pCross=0.8    =>    --pCross=0.65                          
--pMut=0.4    =>     --pMut=0.1                              
Mikaz-fr commented 11 years ago

Ok it crashed again, I put the valgrind log of the client here: https://gist.github.com/Mikaz-fr/f77ba826d8103042d66a

And here is the missing file from last post (curRobot, there is no population save since the first generation doesn't seems to be finished): https://dl.dropboxusercontent.com/u/1703878/seg_fault2.zip

akshararai commented 11 years ago

We had the same problem when changed the selection method to roulette. I think that is where the problem lies.

prfernando commented 11 years ago

I can confirm that there is a bug and as @akshararai pointed out it is because of the roulette wheel selection. Unfortunately, this bug is in the Paradiseo code. This can be reported to them but I don't expect a fix in the next 10 days. But if you want a higher selection pressure as in roulette wheel selection, just use Deterministic Tournament Selection with a bigger tournament size. I can confirm that this is working for your settings.

Mikaz-fr commented 11 years ago

Ok great, we'll use something else that Roulette for the selection then. Thanks for the hint.