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)(
3939env = [" PYTHONHASHSEED=0" ]
4040
4141filterwarnings = [
42+ # A2C/PPO on GPU
43+ " ignore:You are trying to run (PPO|A2C) on the GPU" ,
4244 # Tensorboard warnings
4345 " ignore::DeprecationWarning:tensorboard" ,
4446 # Gymnasium warnings
Original file line number Diff line number Diff line change @@ -758,16 +758,16 @@ def test_no_resource_warning(tmp_path):
758758
759759 # check that files are properly closed
760760 # 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" )
763763
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" )
766766
767767 # Do the same but in memory, should not close the file
768768 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" )
771771 assert not fp .closed
772772
773773 # 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):
659659
660660 # print all videos in video_folder, should be multiple step 0-100, step 1024-1124
661661 video_files = list (map (str , tmp_path .glob ("*.mp4" )))
662+ video_files .sort (reverse = True )
662663
663664 # Clean up
664665 vec_env .close ()
You can’t perform that action at this time.
0 commit comments