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

[BugFix] Looser check for test_recorder assertion #415

Merged
merged 1 commit into from
Sep 11, 2022
Merged
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
27 changes: 16 additions & 11 deletions test/test_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from argparse import Namespace
from collections import OrderedDict
from os import walk, path
from time import sleep

import pytest
import torch
Expand Down Expand Up @@ -268,17 +269,21 @@ def test_recorder():
for (_, _, filenames) in walk(folder):
filename = filenames[0]
break

ea = event_accumulator.EventAccumulator(
path.join(folder, filename),
size_guidance={
event_accumulator.IMAGES: 0,
},
)
ea.Reload()
print(ea.Tags())
img = ea.Images("tmp_ALE/Pong-v5_video")
assert len(img) == N // args.record_interval
for _ in range(3):
ea = event_accumulator.EventAccumulator(
path.join(folder, filename),
size_guidance={
event_accumulator.IMAGES: 0,
},
)
ea.Reload()
print(ea.Tags())
img = ea.Images("tmp_ALE/Pong-v5_video")
try:
assert len(img) == N // args.record_interval
break
except AssertionError:
sleep(0.1)


def test_updateweights():
Expand Down