araffin / rl-baselines-zoo

A collection of 100+ pre-trained RL agents using Stable Baselines, training and hyperparameter optimization included.
https://stable-baselines.readthedocs.io/
MIT License
1.12k stars 206 forks source link

ERROR while using train.py with custom environment #100

Closed meric-sakarya closed 3 years ago

meric-sakarya commented 3 years ago

I am working with a customized Pendulum-v0 environment which has a maximum timestep attribute to allow early resets and therefore reward tracking and also uses rgb-array's for observation. I am trying to use the hyperparameter optimization for that environment and therefore registered the environment to gym as suggested by @Miffyli. I can not run train.py with n_jobs larger than 1.

The code:

(pioneer) 
C:\Users\meric\OneDrive\Masaüstü\TUM\Thesis\Code\Zoo\rl-baselines-zoo>python train.py --algo ppo2 --env PendulumIMG-v0 -n 50000 -optimize --n-trials 100 --n-jobs 2 --sampler random --pruner median

2020-08-24 16:48:55.212835: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll

WARNING:tensorflow: The TensorFlow contrib module will not be included in TensorFlow 2.0.                                                        For more information, please see:                                                                                              
* https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md                                        
* https://github.com/tensorflow/addons                                                                                       
* https://github.com/tensorflow/io (for I/O related ops)                                                                   
If you depend on functionality not listed there, please file an issue.                                                                                                                                                                                    WARNING:tensorflow:From C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\common\misc_util.py:26: The name tf.set_random_seed is deprecated. Please use tf.compat.v1.set_random_seed instead.                                                                                                                                                                   ========== PendulumIMG-v0 ==========                                                                                         
Seed: 0                                                                                                                      
OrderedDict([('cliprange', 0.2),                                                                                                          
('ent_coef', 0.0),                                                                                                           
('gamma', 0.99),                                                                                                             
('lam', 0.95),                                                                                                               
('learning_rate', 0.0003),                                                                                                   
('n_steps', 2048),                                                                                                           
('n_timesteps', 2000000.0),                                                                                                  
('nminibatches', 32),                                                                                                        
('noptepochs', 10),                                                                                                          
('policy', 'MlpPolicy')])                                                                                       
Using 1 environments                                                                                                         
Overwriting n_timesteps with n=50000                                                                                         
Creating test environment                                                                                                    
Optimizing hyperparameters                                                                                                   
Sampler: random - Pruner: median                                                                                             
WARNING:tensorflow:From C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\common\tf_util.py:191: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.                                                                                                                                                                            WARNING:tensorflow:From C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\common\tf_util.py:200: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.                                                                                                                                                                                    2020-08-24 16:48:58.804156: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2                                                                                 
2020-08-24 16:48:58.808697: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll                                                                                                                
2020-08-24 16:48:59.234388: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties:         name: GeForce GTX 1050 major: 6 minor: 1 memoryClockRate(GHz): 1.493                                                         
pciBusID: 0000:01:00.0                                                                                                       
2020-08-24 16:48:59.234620: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll                                                                                                          
2020-08-24 16:48:59.239386: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_100.dll                                                                                                          
2020-08-24 16:48:59.243933: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_100.dll                                                                                                           
2020-08-24 16:48:59.246060: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_100.dll                                                                                                          
2020-08-24 16:48:59.250758: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_100.dll                                                                                                        
2020-08-24 16:48:59.253638: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_100.dll                                                                                                        
2020-08-24 16:48:59.263978: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll                                                                                                             
2020-08-24 16:48:59.264324: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0           2020-08-24 16:48:59.909666: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix:                                                                                                      
2020-08-24 16:48:59.910059: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165]      0                                  
2020-08-24 16:48:59.911490: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0:   N                                  
2020-08-24 16:48:59.912589: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1304] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3001 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050, pci bus id: 0000:01:00.0, compute capability: 6.1)                                                                                               
2020-08-24 16:48:59.914510: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties:         name: GeForce GTX 1050 major: 6 minor: 1 memoryClockRate(GHz): 1.493                                                         
pciBusID: 0000:01:00.0                                                                                                       
2020-08-24 16:48:59.914730: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll                                                                                                          
2020-08-24 16:48:59.915234: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_100.dll                                                                                                          
2020-08-24 16:48:59.915871: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_100.dll                                                                                                           
2020-08-24 16:48:59.916369: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_100.dll                                                                                                          
2020-08-24 16:48:59.917129: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_100.dll                                                                                                        
2020-08-24 16:48:59.917621: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_100.dll                                                                                                        
2020-08-24 16:48:59.918279: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll                                                                                                             
2020-08-24 16:48:59.918792: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0           2020-08-24 16:48:59.919268: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix:                                                                                                      
2020-08-24 16:48:59.919664: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165]      0                                  
2020-08-24 16:48:59.920011: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0:   N                                  
2020-08-24 16:48:59.920561: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1304] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3001 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050, pci bus id: 0000:01:00.0, compute capability: 6.1)                                                                                               WARNING:tensorflow:From C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\common\policies.py:116: The name tf.variable_scope is deprecated. Please use tf.compat.v1.variable_scope instead.                                                                                                                                                                     WARNING:tensorflow:From C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\common\input.py:25: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.                                                                                                                                                                               WARNING:tensorflow:From C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\common\policies.py:561: flatten (from tensorflow.python.layers.core) is deprecated and will be removed in a future version.                              
Instructions for updating:                                                                                                   
Use keras.layers.flatten instead.                                                                                            
WARNING:tensorflow:From C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\tensorflow_core\python\layers\core.py:332: Layer.apply (from tensorflow.python.keras.engine.base_layer) is deprecated and will be removed in a future version.            
Instructions for updating:                                                                                                   
Please use `layer.__call__` method instead.                                                                                  
WARNING:tensorflow:From C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\common\tf_layers.py:123: The name tf.get_variable is deprecated. Please use tf.compat.v1.get_variable instead.                                                                                                                                                                        WARNING:tensorflow:From C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\common\distributions.py:418: The name tf.random_normal is deprecated. Please use tf.random.normal instead.                                                                                                                                                                            WARNING:tensorflow:From C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\ppo2\ppo2.py:190: The name tf.summary.scalar is deprecated. Please use tf.compat.v1.summary.scalar instead.                                                                                                                                                                           WARNING:tensorflow:From C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\ppo2\ppo2.py:198: The name tf.trainable_variables is deprecated. Please use tf.compat.v1.trainable_variables instead.                                                                                                                                                                 WARNING:tensorflow:From C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\tensorflow_core\python\ops\math_grad.py:1424: where (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.                         
Instructions for updating:                                                                                                   Use tf.where in 2.0, which has the same broadcast rule as np.where                                                           WARNING:tensorflow:From C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\ppo2\ppo2.py:206: The name tf.train.AdamOptimizer is deprecated. Please use tf.compat.v1.train.AdamOptimizer instead.                                                                                                                                                                 WARNING:tensorflow:From C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\ppo2\ppo2.py:240: The name tf.global_variables_initializer is deprecated. Please use tf.compat.v1.global_variables_initializer instead.                                                                                                                                               WARNING:tensorflow:From C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\ppo2\ppo2.py:242: The name tf.summary.merge_all is deprecated. Please use tf.compat.v1.summary.merge_all instead.                                                                                                                                                                     [W 2020-08-24 16:49:01,386] Setting status of trial#0 as TrialState.FAIL because of the following error: MissingFunctionException('wglChoosePixelFormatARB is not exported by the available OpenGL driver.  ARB_pixel_format is required for this functionality.')                                                                                                                     
Traceback (most recent call last):                                                                                             
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\optuna\study.py", line 734, in _run_trial                        
result = func(trial)                                                                                                       
File "C:\Users\meric\OneDrive\Masaüstü\TUM\Thesis\Code\Zoo\rl-baselines-zoo\utils\hyperparams_opt.py", line 108, in objective                                                                                                                               
model.learn(n_timesteps, callback=eval_callback)                                                                           
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\ppo2\ppo2.py", line 336, in learn               rollout = self.runner.run(callback)                                                                                        
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\common\base_class.py", line 794, in runner      self._runner = self._make_runner()                                                                                         
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\ppo2\ppo2.py", line 101, in _make_runner        gamma=self.gamma, lam=self.lam)                                                                                            
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\ppo2\ppo2.py", line 449, in __init__            super().__init__(env=env, model=model, n_steps=n_steps)                                                                    
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\common\runners.py", line 31, in __init__        self.obs[:] = env.reset()                                                                                                  
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\common\vec_env\dummy_vec_env.py", line 61, in reset                                                                                                                          
obs = self.envs[env_idx].reset()                                                                                           
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\bench\monitor.py", line 80, in reset            return self.env.reset(**kwargs)                                                                                            
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\gym\wrappers\time_limit.py", line 25, in reset                   
return self.env.reset(**kwargs)                                                                                            
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\gym\envs\classic_control\pendulum_IMG.py", line 84, in reset     return self._get_obs()                                                                                                     
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\gym\envs\classic_control\pendulum_IMG.py", line 88, in _get_obs                                                                                                                               
img = self.render('rgb_array')                                                                                             
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\gym\envs\classic_control\pendulum_IMG.py", line 100, in render                                                                                                                                self.viewer = rendering.Viewer(50, 50)                                                                                     
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\gym\envs\classic_control\rendering.py", line 70, in __init__     self.window = get_window(width=width, height=height, display=display)                                                      
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\gym\envs\classic_control\rendering.py", line 59, in get_window                                                                                                                                config = screen[0].get_best_config() #selecting the first screen                                                           
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\pyglet\canvas\base.py", line 187, in get_best_config             configs = self.get_matching_configs(template_config)                                                                       
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\pyglet\canvas\win32.py", line 69, in get_matching_configs        configs = template.match(canvas)                                                                                           
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\pyglet\gl\win32.py", line 57, in match                           
return self._get_arb_pixel_format_matching_configs(canvas)                                                                 
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\pyglet\gl\win32.py", line 128, in _get_arb_pixel_format_matching_configs                                                                                                                      wglext_arb.wglChoosePixelFormatARB(canvas.hdc, attrs, None, nformats, pformats, nformats)                                  
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\pyglet\gl\lib_wgl.py", line 103, in __call__                     
return self.func(*args, **kwargs)                                                                                          
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\pyglet\gl\lib.py", line 60, in MissingFunction                   
raise MissingFunctionException(name, requires, suggestions)                                                              pyglet.gl.lib.MissingFunctionException: wglChoosePixelFormatARB is not exported by the available OpenGL driver.  ARB_pixel_format is required for this functionality.                                                                                     
2020-08-24 16:49:01.467203: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties:         name: GeForce GTX 1050 major: 6 minor: 1 memoryClockRate(GHz): 1.493                                                         
pciBusID: 0000:01:00.0                                                                                                       
2020-08-24 16:49:01.467503: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll                                                                                                          
2020-08-24 16:49:01.469300: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_100.dll                                                                                                          
2020-08-24 16:49:01.470278: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_100.dll                                                                                                           
2020-08-24 16:49:01.472895: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_100.dll                                                                                                          
2020-08-24 16:49:01.476622: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_100.dll                                                                                                        
2020-08-24 16:49:01.478698: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_100.dll                                                                                                        
2020-08-24 16:49:01.479360: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll                                                                                                             
2020-08-24 16:49:01.480079: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0           2020-08-24 16:49:01.480605: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix:                                                                                                      
2020-08-24 16:49:01.481265: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165]      0                                  
2020-08-24 16:49:01.481671: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0:   N                                  
2020-08-24 16:49:01.482168: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1304] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3001 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050, pci bus id: 0000:01:00.0, compute capability: 6.1)                                                                                               
Traceback (most recent call last):                                                                                             
File "train.py", line 385, in <module>                                                                                         
verbose=args.verbose)                                                                                                      
File "C:\Users\meric\OneDrive\Masaüstü\TUM\Thesis\Code\Zoo\rl-baselines-zoo\utils\hyperparams_opt.py", line 130, in hyperparam_optimization                                                                                                                 
study.optimize(objective, n_trials=n_trials, n_jobs=n_jobs)                                                                
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\optuna\study.py", line 382, in optimize                          
for _ in _iter                                                                                                             
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\joblib\parallel.py", line 1042, in __call__                      self.retrieve()                                                                                                            
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\joblib\parallel.py", line 921, in retrieve                       self._output.extend(job.get(timeout=self.timeout))                                                                         
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\multiprocessing\pool.py", line 657, in get                                     
raise self._value                                                                                                          
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\multiprocessing\pool.py", line 121, in worker                                  
result = (True, func(*args, **kwds))                                                                                       
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\joblib\_parallel_backends.py", line 595, in __call__             
return self.func(*args, **kwargs)                                                                                          
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\joblib\parallel.py", line 253, in __call__                       
for func, args, kwargs in self.items]                                                                                      
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\joblib\parallel.py", line 253, in <listcomp>                     
for func, args, kwargs in self.items]                                                                                      
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\optuna\study.py", line 648, in _reseed_and_optimize_sequential                                                                                                                                func, n_trials, timeout, catch, callbacks, gc_after_trial, time_start                                                      
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\optuna\study.py", line 682, in _optimize_sequential              self._run_trial_and_callbacks(func, catch, callbacks, gc_after_trial)                                                      
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\optuna\study.py", line 713, in _run_trial_and_callbacks          
trial = self._run_trial(func, catch, gc_after_trial)                                                                       
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\optuna\study.py", line 734, in _run_trial                        
result = func(trial)                                                                                                       
File "C:\Users\meric\OneDrive\Masaüstü\TUM\Thesis\Code\Zoo\rl-baselines-zoo\utils\hyperparams_opt.py", line 108, in objective                                                                                                                               
model.learn(n_timesteps, callback=eval_callback)                                                                           
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\ppo2\ppo2.py", line 336, in learn               rollout = self.runner.run(callback)                                                                                        
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\common\base_class.py", line 794, in runner      self._runner = self._make_runner()                                                                                         
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\ppo2\ppo2.py", line 101, in _make_runner        gamma=self.gamma, lam=self.lam)                                                                                            
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\ppo2\ppo2.py", line 449, in __init__            super().__init__(env=env, model=model, n_steps=n_steps)                                                                  
2020-08-24 16:49:01.655738: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_100.dll                                                                                                            
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\common\runners.py", line 31, in __init__        self.obs[:] = env.reset()                                                                                                  
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\common\vec_env\dummy_vec_env.py", line 61, in reset                                                                                                                          
obs = self.envs[env_idx].reset()                                                                                           
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\stable_baselines\bench\monitor.py", line 80, in reset            return self.env.reset(**kwargs)                                                                                            
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\gym\wrappers\time_limit.py", line 25, in reset                   
return self.env.reset(**kwargs)                                                                                            
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\gym\envs\classic_control\pendulum_IMG.py", line 84, in reset     return self._get_obs()                                                                                                     
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\gym\envs\classic_control\pendulum_IMG.py", line 88, in _get_obs                                                                                                                               
img = self.render('rgb_array')                                                                                             
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\gym\envs\classic_control\pendulum_IMG.py", line 100, in render                                                                                                                                self.viewer = rendering.Viewer(50, 50)                                                                                     
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\gym\envs\classic_control\rendering.py", line 70, in __init__     self.window = get_window(width=width, height=height, display=display)                                                      
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\gym\envs\classic_control\rendering.py", line 59, in get_window                                                                                                                                config = screen[0].get_best_config() #selecting the first screen                                                           
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\pyglet\canvas\base.py", line 187, in get_best_config             configs = self.get_matching_configs(template_config)                                                                       
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\pyglet\canvas\win32.py", line 69, in get_matching_configs        configs = template.match(canvas)                                                                                           
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\pyglet\gl\win32.py", line 57, in match                           
return self._get_arb_pixel_format_matching_configs(canvas)                                                                 
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\pyglet\gl\win32.py", line 128, in _get_arb_pixel_format_matching_configs                                                                                                                      wglext_arb.wglChoosePixelFormatARB(canvas.hdc, attrs, None, nformats, pformats, nformats)                                  
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\pyglet\gl\lib_wgl.py", line 103, in __call__                     
return self.func(*args, **kwargs)                                                                                          
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\pyglet\gl\lib.py", line 60, in MissingFunction                   
raise MissingFunctionException(name, requires, suggestions)                                                              pyglet.gl.lib.MissingFunctionException: wglChoosePixelFormatARB is not exported by the available OpenGL driver.  ARB_pixel_format is required for this functionality.                                                                                     
Exception ignored in: <function Viewer.__del__ at 0x0000021B8CE99318>                                                        
Traceback (most recent call last):                                                                                             
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\gym\envs\classic_control\rendering.py", line 162, in __del__   
File "C:\Users\meric\Anaconda3\envs\pioneer\lib\site-packages\gym\envs\classic_control\rendering.py", line 81, in close    AttributeError: 'Viewer' object has no attribute 'window' 

Error 1:

Any suggestion would be greatly appreciated!

System Info Describe the characteristic of your environment:

araffin commented 3 years ago

Hello,

Please format the traceback using codeblock.

meric-sakarya commented 3 years ago

I copy pasted the traceback in the code block how do I format it?

araffin commented 3 years ago

The error:

MissingFunctionException('wglChoosePixelFormatARB is not exported by the available OpenGL driver. ARB_pixel_format is required for this functionality.') 

Related to https://github.com/Kautenja/nes-py/issues/50

Closing this issue as not related to Stable-Baselines but to OpenGL and the machine you are using.

As mentioned in other issues and in the issue template, please note that we do not do tech support.

meric-sakarya commented 3 years ago

But I am able to train the agents using PPO2 with more than one environment and that creates multiple rendered windows. The issue only happens with train.py for hyperparameter optimization. @araffin