Hi,
I am attempting to simply replicate your work but am having issues getting the code to run correctly. When I first attempt to run the 'train_terminal.py' file, I get the following error back:
Traceback (most recent call last):
File "train_terminal.py", line 84, in
my_mission = env.create_environment(task, seed=SEED+episode_num)
File "C:\Users\kr015\Sync\PhD MineRL\hierarchical-skill-acquisition\env.py", line 115, in create_environment
mission = MalmoPython.MissionSpec(ET.tostring(tree.getroot()), True)
RuntimeError: Caught std::exception: MissionSpec is invalid (namespace)
It seems that line 115 in env.py is not accepting the mission spec input. I can fix this by replacing this line with the following as given in the malmo instruction:
with open(env_file, 'r') as f:
mission_xml = f.read()
mission = MalmoPython.MissionSpec(mission_xml, True)
This enable the environment to start but in doing so, returns a new error:
Waiting for the mission to start ....
Waiting for the first observation...
Waiting for the first frame...
The mission has started...
Traceback (most recent call last):
File "train_terminal.py", line 138, in
action_probs = policy.forward(Variable(last_frames.unsqueeze(0)), Variable(instruction))
File "C:\Users\kr015\Sync\PhD MineRL\hierarchical-skill-acquisition\agent\hierarchical\terminal.py", line 53, in forward
time_encoding = self.time.forward(fused)
File "C:\Users\kr015\Sync\PhD MineRL\hierarchical-skill-acquisition\agent\hierarchical\modules.py", line 99, in forward
output, hidden = self.lstm(fused, hidden)
File "C:\Users\kr015\Anaconda3\envs\minecraft_env\lib\site-packages\torch\nn\modules\module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "C:\Users\kr015\Anaconda3\envs\minecraft_env\lib\site-packages\torch\nn\modules\rnn.py", line 564, in forward
return self.forward_tensor(input, hx)
File "C:\Users\kr015\Anaconda3\envs\minecraft_env\lib\site-packages\torch\nn\modules\rnn.py", line 543, in forward_tensor
output, hidden = self.forward_impl(input, hx, batch_sizes, max_batch_size, sorted_indices)
File "C:\Users\kr015\Anaconda3\envs\minecraft_env\lib\site-packages\torch\nn\modules\rnn.py", line 523, in forward_impl
self.check_forward_args(input, hx, batch_sizes)
File "C:\Users\kr015\Anaconda3\envs\minecraft_env\lib\site-packages\torch\nn\modules\rnn.py", line 500, in check_forward_args
'Expected hidden[0] size {}, got {}')
File "C:\Users\kr015\Anaconda3\envs\minecraft_env\lib\site-packages\torch\nn\modules\rnn.py", line 166, in check_hidden_size
raise RuntimeError(msg.format(expected_hidden_size, tuple(hx.size())))
RuntimeError: Expected hidden[0] size (1, 1, 256), got (1, 256)
For which I have not figured out how to fix and assumed that perhaps editing the mission spec caused problems elsewhere. Is there a better fix to the first issue?
Furthermore, when I explore the defined environment manually, I see the perimeter walls as defined in the xml file but there are no coloured blocks anywhere to be seen. Is this correct or should the environment have the coloured blocks initialised?
Thanks
Phil