Open erniemcb13 opened 2 years ago
Could you do the following:
pip uninstall ctoybox
pip list | grep ctoybox
to make sure you uninstalled it (nothing should print out)git pull origin tb-agents-issue-10
maturin develop --release
, or cd ctoybox && ./test.sh
python -m agents --game Breakout --agentclass StayAlive
again.If you are successful, great! Let me know so we can close this issue and I can merge the toybox-rs branch into main.
If it doesn't work, could you search through the output and see if it is printing the special message I added? This will help me figure out whether my code is incorrect or if your local ToyboxAgents is simply pointing to the wrong version of toybox-rs. Here is how you find the message:
Pipe the output: python -m agents --game Breakout --agentclass StayAlive > output.txt
. If it hangs (e.g., nothing happens for like a minute), kill the process; it ought to still write the output file just fine. Check to see if output.txt is empty. Let me know if it is (I'm not sure what the problem would be, but we'll cross that bridge once we come to it). Once you have a non-empty output.txt, run grep Message output.txt
and let me know what it prints, if anything.
Let me know if you get stuck anywhere.
When trying to run an agent through the command "python -m agents --game Breakout --agentclass StayAlive" (or with any agent in the system), the following error occurs:
Traceback (most recent call last): File "C:\Users\mcbri\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\mcbri\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\mcbri\dev\ToyboxAgents\agents__main.py", line 22, in
importlib.import_module('agents.' + game_lower + '.' + args.agentclass.lower())
File "C:\Users\mcbri\AppData\Local\Programs\Python\Python310\lib\importlib__init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 992, in _find_and_load_unlocked
File "", line 241, in _call_with_frames_removed
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "C:\Users\mcbri\dev\ToyboxAgents\agents\breakout\ init.py", line 3, in
from agents.base import Agent
File "C:\Users\mcbri\dev\ToyboxAgents\agents\base.py", line 5, in
from toybox.interventions import Game, state_from_toybox
File "C:\Users\mcbri\dev\ToyboxAgents\venv\lib\site-packages\toybox\interventions\ init.py", line 3, in
from .space_invaders import SpaceInvadersIntervention, SpaceInvaders
File "C:\Users\mcbri\dev\ToyboxAgents\venv\lib\site-packages\toybox\interventions\space_invaders.py", line 9, in
class SpaceInvaders(Game):
File "C:\Users\mcbri\dev\ToyboxAgents\venv\lib\site-packages\toybox\interventions\space_invaders.py", line 11, in SpaceInvaders
with Toybox('space_invaders') as tb:
File "\?\C:\Users\mcbri\dev\ToyboxAgents\toybox-rs\ctoybox\ctoybox\ffi.py", line 360, in init__
self.rsimulator = Simulator(game_name)
File "\?\C:\Users\mcbri\dev\ToyboxAgents\toybox-rs\ctoybox\ctoybox\ffi.py", line 90, in init__
sim = _handle_ffi_result(lib.simulator_alloc(game_name.encode("utf-8")))
File "\?\C:\Users\mcbri\dev\ToyboxAgents\toybox-rs\ctoybox\ctoybox\ffi.py", line 52, in _handle_ffi_result
_raise_error_str(error)
File "\?\C:\Users\mcbri\dev\ToyboxAgents\toybox-rs\ctoybox\ctoybox\ffi.py", line 27, in _raise_error_str
raise ValueError("{0}: {1}".format(response["error"], response["context"]))
ValueError: error: "Cannot construct game:
space_invaders
. Try any of [\"amidar\", \"breakout\", \"gridworld\", \"spaceinvaders\", \"pong\", \"pitfall\"]." Exception ignored in: <function Simulator.del at 0x00000260C2CFCE50> Traceback (most recent call last): File "\?\C:\Users\mcbri\dev\ToyboxAgents\toybox-rs\ctoybox\ctoybox\ffi.py", line 97, in del if not self.deleted: AttributeError: 'Simulator' object has no attribute 'deleted' Exception ignored in: <function Toybox.del at 0x00000260C2CFEA70> Traceback (most recent call last): File "\?\C:\Users\mcbri\dev\ToyboxAgents\toybox-rs\ctoybox\ctoybox\ffi.py", line 566, in del if not self.deleted: AttributeError: 'Toybox' object has no attribute 'deleted'