Baselines: How can I run PPO2 on GPU ?

Created on 20 Apr 2018  路  6Comments  路  Source: openai/baselines

question

Most helpful comment

"allow_soft_placement=True" in the config can select your GPU device if you has GPU, also you can select your GPU device using like this:
with device('gpu:/0')

All 6 comments

"allow_soft_placement=True" in the config can select your GPU device if you has GPU, also you can select your GPU device using like this:
with device('gpu:/0')

It works ! thank you so much @Kelvinson

our implementation of PPO2 runs on tensorflow, so, as @Kelvinson pointed out, standard tensorflow magic will make it run on gpu. Please refer to https://www.tensorflow.org/programmers_guide/using_gpu for more details.

Hello everyone,
Where did you change this parameter (allow_soft_placement=True) ? I am quite new in this field.. Can we force to have more computational power from the GPU (per_process_gpu_memory_fraction = 0.4)
? I went on https://www.tensorflow.org/guide/using_gpu but I don't know where do the different modification.
Kind regards,
John

EDIT:
I inserted in my main those two lines:
import tensorflow as tf sess = tf.Session(config=tf.ConfigProto(allow_soft_placement=True, log_device_placement=True))

It seems to work but I think that it only block the memory of the GPU but sill doesn't use it because I didn't give the session to MlpPolicy...
How can I do that ? Or do someone have a better solution ?

@Deastan could you specify the command you are running? Currently ppo2 is set to work with allow_soft_placement=True tensorflow config parameter (you can see/change that here: https://github.com/openai/baselines/blob/7c520852d9cf4eaaad326a3d548efc915dc60c10/baselines/common/tf_util.py#L63).

Yes you right... I don't know what was happening so..

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RebornHugo picture RebornHugo  路  3Comments

araffin picture araffin  路  3Comments

joe95it picture joe95it  路  3Comments

benelot picture benelot  路  4Comments

alapite picture alapite  路  4Comments