tensorflow / agents

TF-Agents: A reliable, scalable and easy to use TensorFlow library for Contextual Bandits and Reinforcement Learning.
Apache License 2.0
2.8k stars 722 forks source link

Issue with test ddpg #259

Closed vedantammihir closed 4 years ago

vedantammihir commented 4 years ago

When I try to run the example DDPG test and eval scripts, I get the following issue: module 'tensorflow' has no attribute 'enable_resource_variables'

If I change this line to: tf.compat.v1.enable_resource_variables()

Then I get the following error:

RuntimeError: dataset.make_initializable_iterator is not supported when eager execution is enabled. Use for element in dataset instead. In call to configurable 'train_eval' (<function train_eval at 0x7f10910917a0>)

I am trying to avoid making too many changes to the provided script, but I had to change the environment due to not having mujoco: env_name="Pendulum-v0", env_load_fn=suite_gym.load,

kuanghuei commented 4 years ago

Which version of tensorflow do you use?

jdossgollin commented 4 years ago

I'm having the same problem! From a pip freeze I get

tf-agents-nightly==0.2.0.dev20191130
tf-estimator-nightly==2.0.0.dev2019113009
tf-nightly==2.1.0.dev20191130
tfp-nightly==0.9.0.dev20191130
kuanghuei commented 4 years ago

I think it's probably because you are using tf2 but running the v1 example (enable_resource_variables only exists in the v1 example)? I guess either running v2 examples or pinning tf version to 1.15 should work. Let me know if this solves the issue for you.

ebrevdo commented 4 years ago

As @kuanghuei said; you should be instead running the examples from this directory. If those still pose a problem, please reopen this issue.