-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Issue running custom agents. #110
Comments
The command should be something like
Assuming that
you can try running
in the C:\Users\Danielle directory. Otherwise it might be simpler to navigate to the folder of your agent script and run it from there. Hope that helps! |
I have tried the command
I got the same error as last time. Can you specify running it from the folder where my agent script is? On another note it seems to not allow to me choose any specific agent same error each time. |
Sorry for the double post after executing the script from its folder the game begins to boot up than crashes giving me the following text. PS C:\Users\Danielle\AppData\Local\Programs\Python\Python35\Lib\site-packages\pysc2\agents> python -m pysc2.bin.agent --map Simple64 --agent Adjeera.Adjeera --ag |
You have to call the constructor of It should look something like this: class Adjeera(base_agent.BaseAgent):
def __init__(self):
super(Adjeera, self).__init__()
# other things to be done by the constructor go here |
This is what it currently looks like.
When I try to add the
It gives me several new errors. |
What kind of new errors? Can you please post them here? |
This is what im getting now PS C:\Users\Danielle\AppData\Local\Programs\Python\Python35\Lib\site-packages\pysc2\agents> python -m pysc2.bin.agent --map Simple64 --agent Adjeera.Adjeera --agent_race T --max_agent_steps 0 Essentially the same errors with the addition of the last one using the code you gave me. |
you seem to be calling |
I know it looks like that but it shows up as |
Yes, post the full code for your class. Btw. the reason why |
This is what I have based on the few tutorials I found and read over. `class Adjeera(base_agent.BaseAgent):
|
I tried your code (with added Were there some lines lost while copying and pasting the error message here? If so check out this: tensorflow/tensorflow#7529 it seems to be an similar issue. |
No that's the whole code for my class and the error messages I received to be safe i double checked the referenced issue and made sure i wasn't missing certain files just to be sure. Edit: Nvm double checking again |
After fixing some of the files i was missing I'm still getting error codes namely these. PS C:\Users\Danielle\AppData\Local\Programs\Python\Python35\Lib\site-packages\pysc2\agents> python -m pysc2.bin.agent --map Simple64 --agent Adjeera.Adjeera --agent_race T |
Ok, good. Now that those errors are fixed you just have to add The reason why you get this error is because in your |
I put it right where it was shown above like so ofc it all isn't posting as markup.
This is the error I get when i add PS C:\Users\Danielle\AppData\Local\Programs\Python\Python35\Lib\site-packages\pysc2\agents> python -m pysc2.bin.agent -- |
Maybe you can try checking the indentations and make sure they are consistent? Since the error you pasted seems to be a TabError at the |
Sorry if I've been a pain to help still very new to this and you have all been very helpful, I fixed the indentations it runs for 5 to 10 seconds before crashing with new errors this time. PS C:\Users\Danielle\AppData\Local\Programs\Python\Python35\Lib\site-packages\pysc2\agents> python -m pysc2.bin.agent --map Simple64 --agent Adjeera.Adjeera --agent_race |
It seems to be something related to the argmax call. Can you try uploading your code to a repo or posting it as a gist so we can take a look at it? |
Uploaded it to https://github.com/Arkknightmare/Adjeera |
Hey I've tried running your code and it actually works fine on my laptop. Looking at your error message, it looks like it's related to the newest version of pandas (I'm still on pandas==0.15.2), see discussion here. TL;DR what you can do is downgrade your pandas or just change line 74 in your code to |
Yes adding values to the line finally fixed it and I can finally move forward thanks for all your help everyone. |
After following multiple tutorials i keep getting this error when trying to run my custom agent. I am still new to python and would appriciate the help here is what I am getting.
C:\Users\Danielle>python -m pysc2.bin.agent --map Simple64 --agent pysc2.agents.Adjeera.Adjeera --agent_race T --max_agent_steps 0
Traceback (most recent call last):
File "C:\Users\Danielle\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 184, in _run_module_as_main
"main", mod_spec)
File "C:\Users\Danielle\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Danielle\AppData\Local\Programs\Python\Python35\lib\site-packages\pysc2\bin\agent.py", line 112, in
app.run(main)
File "C:\Users\Danielle\AppData\Local\Programs\Python\Python35\lib\site-packages\absl\app.py", line 272, in run
_run_main(main, argv)
File "C:\Users\Danielle\AppData\Local\Programs\Python\Python35\lib\site-packages\absl\app.py", line 237, in run_main
sys.exit(main(argv))
File "C:\Users\Danielle\AppData\Local\Programs\Python\Python35\lib\site-packages\pysc2\bin\agent.py", line 90, in main
agent_cls = getattr(importlib.import_module(agent_module), agent_name)
File "C:\Users\Danielle\AppData\Local\Programs\Python\Python35\lib\importlib_init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 956, in _find_and_load_unlocked
ImportError: No module named 'pysc2.agents.Adjeera'
The text was updated successfully, but these errors were encountered: