Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2023 January] Changes required to run installation on macosx #381

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
'psutil',
'scipy',
'seaborn==0.8.1',
'tensorflow>=1.8.0,<2.0',
'torch==1.3.1',
'tensorflow>=1.8.0,<3.0',
'torch==1.13.1',
'tqdm'
],
description="Teaching tools for introducing people to deep RL.",
Expand Down
6 changes: 3 additions & 3 deletions spinup/utils/mpi_tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def sync_all_params():
return sync_params(tf.global_variables())


class MpiAdamOptimizer(tf.train.AdamOptimizer):
class MpiAdamOptimizer(tf.compat.v1.train.AdamOptimizer):
"""
Adam optimizer that averages gradients across MPI processes.

Expand All @@ -40,7 +40,7 @@ class MpiAdamOptimizer(tf.train.AdamOptimizer):

def __init__(self, **kwargs):
self.comm = MPI.COMM_WORLD
tf.train.AdamOptimizer.__init__(self, **kwargs)
tf.compat.v1.train.AdamOptimizer.__init__(self, **kwargs)

def compute_gradients(self, loss, var_list, **kwargs):
"""
Expand Down Expand Up @@ -75,4 +75,4 @@ def apply_gradients(self, grads_and_vars, global_step=None, name=None):
opt = super().apply_gradients(grads_and_vars, global_step, name)
with tf.control_dependencies([opt]):
sync = sync_params([v for g,v in grads_and_vars])
return tf.group([opt, sync])
return tf.group([opt, sync])