Closed martinezjulio closed 3 years ago
Did you run the TDW build separately? It seems from your description that the controller is not able to connect to TDW
I'm not sure how to run it separately on a Mac. If I try to execute/launch tdw separately I run into file damaged error which is why I usually use launch_build=True in the controller itself. Has this worked for you on a Mac?
I have added an option to launch the build. Try re-installing the library.
env = gym.make("transport_challenge-v0", train = 0, physics = True, port = 1071, launch_build=True)
Let me know if that worked
Ok that is great, that got me past that part and those lines seems to work now so thank you.
I ran into another error after from the following lines:
with open(pkg_resources.resource_filename("tdw_transport_challenge","train_dataset.pkl")) as fp:
dataset = pickle.load(fp)
The error output is the following:
Controller connected
Traceback (most recent call last):
File "test.py", line 14, in <module>
dataset = pickle.load(fp)
File "/usr/local/anaconda3/envs/tdwEnv2/lib/python3.7/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
The directory tdw_transport_challenge is local and the file "train_dataset.pkl" is in there so I'm not sure if something else I'm doing wrong.
Use binary mode to load the pickle file
with open(pkg_resources.resource_filename("tdw_transport_challenge","train_dataset.pkl"), 'rb') as fp:
dataset = pickle.load(fp)
I have also made that change in the Readme
Ok thanks.
Running into another error from inside the while loop, sorry for all the bother.
Controller connected
Traceback (most recent call last):
File "test.py", line 27, in <module>
action = agent.act(obs, info)
File "/Users/juliomartinez/Documents/tdwProject2/tdw-transport-challenge/tdw_transport_challenge/h_agent.py", line 490, in act
if self.sub_goal != -1:
AttributeError: 'H_agent' object has no attribute 'sub_goal'
Call agent.reset()
after creating it. You can refer to the test.py
for usage. There are still some bugs in the hard-coded agent (H_agent) so you might run into some other errors while running the test.py
script. But you can still use the environment to train your own agent.
Ok great, thanks a ton!
I am getting a hang after executing the the following line shown in the example under "Not using Docker":
I am running this on my Mac. After hitting control + c I get the following message:
I had a similar error with magnebot, but after including launch_build=True in the controller instantiation it worked. Not sure how I could fix that here tho. Any suggestions are appreciated.