Relative Imports
The relative imports produce an error on my machine:
Traceback (most recent call last):
File "train_with_tensorforce.py", line 22, in <module>
from .. import helpers, make
ValueError: attempted relative import beyond top-level package
This is the same error as described here- #83
Adding absolute imports as described here fixes it.
Actions not being unflattened
After fixing the imports, I still received an error-
Traceback (most recent call last):
File "train_with_tensorforce.py", line 153, in <module>
main()
File "train_with_tensorforce.py", line 142, in main
runner.run(episodes=10, max_episode_timesteps=2000)
File "/home/nihal111/.local/lib/python3.6/site-packages/tensorforce/execution/runner.py", line 104, in run
state, terminal, step_reward = self.environment.execute(action=action)
TypeError: execute() got an unexpected keyword argument 'action'
Looking at the notebook that appears to do the same thing, I understand that the execute method inside the WrappedEnv class is defined in a different way. The following line was missing in train_with_tensorforce.py-
actions = self.unflatten_action(action=action)
This PR fixes both of these issues on my machine. Hope this helps.
Thanks for looking into this @nihal111 ! This looks ~lgtm to me. We unfortunately have not kept up to date with Tensorforce modifications and so we depend on these fixes from our contributors.
When running the train_with_tensorforce.py script as-
I face two issues-
Relative Imports The relative imports produce an error on my machine:
This is the same error as described here- #83
Adding absolute imports as described here fixes it.
Actions not being unflattened After fixing the imports, I still received an error-
Looking at the notebook that appears to do the same thing, I understand that the execute method inside the WrappedEnv class is defined in a different way. The following line was missing in
train_with_tensorforce.py
-This PR fixes both of these issues on my machine. Hope this helps.