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

when "file_name + .zip" exists, should "model.n_steps" be ep_length // 8, as small as not exists? #148

Closed
Garbage123King opened this issue Dec 7, 2023 · 2 comments · May be fixed by #151

Comments

@Garbage123King
Copy link

with the default setting num_cpu= 16 , I ran out of my 40G RAM and process was killed by system.

sudo cat /var/log/syslog | grep -i "killed"

kernel: [ 1522.255350] Out of memory: Killed process 15384 (python) total-vm:54111924kB, anon-rss:35495356kB, file-rss:72320kB, shmem-rss:14336kB, UID:0 pgtables:76780kB oom_score_adj:0

@Garbage123King Garbage123King changed the title Is "16 cores and ~20G of RAM" in readme.md a mistake? It makes me confused. Is "16 cores and ~20G of RAM" in README.md a mistake? It makes me confused. Dec 7, 2023
@Garbage123King
Copy link
Author

I just found that, if I start with a new folder, then I will use less memory, because it began training every 2.5k steps.
But if I start with a old exists folder, then I will use 50+ GB memory at the last traning moment. It start training every 20480 steps.

@Garbage123King Garbage123King reopened this Dec 7, 2023
@Garbage123King Garbage123King changed the title Is "16 cores and ~20G of RAM" in README.md a mistake? It makes me confused. when "file_name + .zip" exists, should "model.n_steps" be ep_length // 8, as small as not exists? Dec 9, 2023
@Garbage123King
Copy link
Author

file_name = 'session_e41c9eff/poke_38207488_steps'

if exists(file_name + '.zip'):
    print('\nloading checkpoint')
    model = PPO.load(file_name, env=env)
    model.n_steps = ep_length      #should this be ep_length // 8 ? Or it is on purpose?
    model.n_envs = num_cpu
    model.rollout_buffer.buffer_size = ep_length
    model.rollout_buffer.n_envs = num_cpu
    model.rollout_buffer.reset()
else:
    model = PPO('CnnPolicy', env, verbose=1, n_steps=ep_length // 8, batch_size=128, n_epochs=3, gamma=0.998, tensorboard_log=sess_path)

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

Successfully merging a pull request may close this issue.

1 participant