File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ exclude = """(?x)(
39
39
env = [" PYTHONHASHSEED=0" ]
40
40
41
41
filterwarnings = [
42
+ # A2C/PPO on GPU
43
+ " ignore:You are trying to run (PPO|A2C) on the GPU" ,
42
44
# Tensorboard warnings
43
45
" ignore::DeprecationWarning:tensorboard" ,
44
46
# Gymnasium warnings
Original file line number Diff line number Diff line change @@ -758,16 +758,16 @@ def test_no_resource_warning(tmp_path):
758
758
759
759
# check that files are properly closed
760
760
# Create a PPO agent and save it
761
- PPO ("MlpPolicy" , "CartPole-v1" ).save (tmp_path / "dqn_cartpole" )
762
- PPO .load (tmp_path / "dqn_cartpole" )
761
+ PPO ("MlpPolicy" , "CartPole-v1" , device = "cpu" ).save (tmp_path / "dqn_cartpole" )
762
+ PPO .load (tmp_path / "dqn_cartpole" , device = "cpu" )
763
763
764
- PPO ("MlpPolicy" , "CartPole-v1" ).save (str (tmp_path / "dqn_cartpole" ))
765
- PPO .load (str (tmp_path / "dqn_cartpole" ))
764
+ PPO ("MlpPolicy" , "CartPole-v1" , device = "cpu" ).save (str (tmp_path / "dqn_cartpole" ))
765
+ PPO .load (str (tmp_path / "dqn_cartpole" ), device = "cpu" )
766
766
767
767
# Do the same but in memory, should not close the file
768
768
with tempfile .TemporaryFile () as fp :
769
- PPO ("MlpPolicy" , "CartPole-v1" ).save (fp )
770
- PPO .load (fp )
769
+ PPO ("MlpPolicy" , "CartPole-v1" , device = "cpu" ).save (fp )
770
+ PPO .load (fp , device = "cpu" )
771
771
assert not fp .closed
772
772
773
773
# Same but with replay buffer
Original file line number Diff line number Diff line change @@ -659,6 +659,7 @@ def test_video_recorder(tmp_path):
659
659
660
660
# print all videos in video_folder, should be multiple step 0-100, step 1024-1124
661
661
video_files = list (map (str , tmp_path .glob ("*.mp4" )))
662
+ video_files .sort (reverse = True )
662
663
663
664
# Clean up
664
665
vec_env .close ()
You can’t perform that action at this time.
0 commit comments