Closed yueyang130 closed 7 months ago
It seems the problem of initializing server dependent on machine...
When I try to run code in local linux machine instead of cloud cluster, it runs well.
Well, I finally got a workaround for running env with image in headless Linux server, i.e., running virtual display and virtual GUI.
install sudo apt-get install xvfb
start Xvfb :99 -screen 0 1024x768x24 &
Set the DISPLAY environment variable export DISPLAY=:99
2.setup Windows terminal emulator
install sudo apt-get install xterm
run xterm &
xterm -e "bash -c 'cd ../sciencebirdsgames/{} && java -jar ./game_playing_interface.jar --headless --dev; bash'" &
When I run
./TestPythonHeuristicAgent.sh RandomAgent
or./TrainLearningAgent.sh within_template
, it raises the following error:I try to print input json file and found the labels of objects are
['Ground' 'Slingshot' 'Object' 'Object' 'Object' 'Object' 'Object']
.However, the object types are defined as follows, thus raising an error.
self.type_transformer = { 'bird_blue': 'blueBird', 'bird_yellow': 'yellowBird', 'bird_black': 'blackBird', 'bird_red': 'redBird', 'bird_white': 'whiteBird', 'platform': 'platform', 'pig_basic_big': 'pig', 'pig_basic_small': 'pig', 'pig_basic_medium': 'pig', 'TNT': 'TNT', 'Slingshot': 'slingshot', 'ice': 'ice', 'stone': 'stone', 'wood': 'wood', 'unknown': 'unknown', }
I guess 'Object' should be sepcific name such as 'bird_blue' or 'pig_basic_bid' to smoothly run? Simply add
'Object': 'unknown'
can avoid error while probably cuasing some other problem for agents I guess. Any help for solving the error would be appreciated!