Closed fc524079318 closed 2 years ago
I'm not sure if this is related to the environment or the workflow. Are you able to run a simple environment like CartPole-v0
?
I can run CartPole-v0 in async workflow and random workflow,and I can run ExaCH-v0 in random flow
In EXARL/exarl/agents/agent_vault/dqn.py", line 309, try casting the reward to a double.
target = tf.add(tf.cast(reward, tf.float64), expectedQ)
Let me know if this fixes the issue. I'll make changes to the code to force cast everything.
I still met the error after changing the reward to a double in dqn.py line 309 like
File "/home/ai/fc/EXARL/exarl/agents/agent_vault/dqn.py", line 309, in calc_target_f
target = tf.add(tf.cast(reward,tf.float64),expectedQ)
File "/home/ai/.local/lib/python3.8/site-packages/tensorflow/python/util/traceback_utils.py", line 153, in error_handler
raise e.with_traceback(filtered_tb) from None
File "/home/ai/.local/lib/python3.8/site-packages/tensorflow/python/framework/ops.py", line 7164, in raise_from_not_ok_status
raise core._status_to_exception(e) from None # pylint: disable=protected-access
tensorflow.python.framework.errors_impl.InvalidArgumentError: cannot compute AddV2 as input #1(zero-based) was expected to be a double tensor but is a float tensor [Op:AddV2]
Let me check and get back to you.
I try to run the ExaCh env with async workflow ,I use the command
mpiexec -np 4 python exarl/driver/__main__.py --workflow async
but there may be some problems with the import path at the line 2 in main.py,it'simport exarl.utils.analyze_reward as ar
and exarl folder is not under driver so I get a ModuleNotFoundError.Could you please tell me the right import path of exarl? Then I change the leaner_cfg.json to run ExaCH env and I can run the env in random workflow correctly.But when I use async workflow ,I met a tensorflow.python.framework.errors_impl.InvalidArgumentError like