DDPG-Keras-Torcs
DDPG-Keras-Torcs copied to clipboard
How to switch torcs from GUI mode to text mode to accelerate the training process
If you assign "False" to the "vision" variable in the "ddpg.py" file, you may want to disable the GUI mode during training process. But it doesn't work if you only change the "vision" variable. Here I find a way to significantly switch torcs to text mode when training: Modify the 33rd line in "gym_torcs.py" like this: os.system('torcs -T -nofuel -nolaptime &') Here we append a new option "-T" for "torcs" command to enable the text mode. It's really easy, but have bothered me for minutes. Hope this can help u guys getting started with the code.
What should you do if you still want to run practice? When I run with -T, it change mode to quick race.
edit: I think I found the answer.
Change /usr/local/games/torcs/config/raceman/practice.xml under the section Practice
change <attstr name="display mode" val="normal"/>
to <attstr name="display mode" val="results only"/>
or run
$ sudo torcs
--> Race| --> Practice or Quick Race --> | Configure race --> Accept
And then set display mode to results only.
When I run the code after changing the line. It runs for few episodes and again gives an error saying that "Unable to open display 'default"
What should you do if you still want to run practice? When I run with -T, it change mode to quick race.
edit: I think I found the answer.
Change /usr/local/games/torcs/config/raceman/practice.xml under the section Practice
change <attstr name="display mode" val="normal"/> to <attstr name="display mode" val="results only"/>
or run
$ sudo torcs
--> Race| --> Practice or Quick Race --> | Configure race --> Accept And then set display mode to results only.
I change display mode to result only, but when I run "sudo torcs -T", it still print "Starting Quick Race". why? Is it really run practice?
I got it. There is no need to append a new option "-T". You should only change the display mode to 'results only' by running $ sudo torcs
.