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

File "/home/layaaa/my_projects/panda/safety_control/utils/mpi_tf.py", line 70, in compute_gradients buf = np.zeros(flat_grad.shape, np.float32) TypeError: __index__ returned non-int (type NoneType) #33

Open
khan008 opened this issue Aug 30, 2024 · 0 comments

Comments

@khan008
Copy link

khan008 commented Aug 30, 2024

I got this error, how can I solved it. I am using tensorflow 1.13.1 and keras 2.2.4.

Traceback (most recent call last):
File "run_training.py", line 20, in
max_ep_len=500,
File "/home/siat/my_projects/robotic-arm-safeRL/safe_rl/pg/algos.py", line 13, in ppo
run_polopt_agent(agent=agent, **kwargs)
File "/home/siat/my_projects/robotic-arm-safeRL/safe_rl/pg/run_agent.py", line 215, in run_polopt_agent
train_pi = MpiAdamOptimizer(learning_rate=agent.pi_lr).minimize(pi_loss)
File "/home/layaaa/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/training/optimizer.py", line 403, in minimize
grad_loss=grad_loss)
File "/home/layaaa/my_projects/panda/safety_control/utils/mpi_tf.py, line 70, in compute_gradients
buf = np.zeros(flat_grad.shape, np.float32)
TypeError: index returned non-int (type NoneType)

@khan008 khan008 changed the title File "/home/siat/my_projects/robotic-arm-safeRL/safe_rl/utils/mpi_tf.py", line 70, in compute_gradients buf = np.zeros(flat_grad.shape, np.float32) TypeError: __index__ returned non-int (type NoneType) File "/home/layaaa/my_projects/panda/safety_control/utils/mpi_tf.py", line 70, in compute_gradients buf = np.zeros(flat_grad.shape, np.float32) TypeError: __index__ returned non-int (type NoneType) Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant