oxwhirl / pymarl

Python Multi-Agent Reinforcement Learning framework
Apache License 2.0
1.89k stars 386 forks source link

the problem of the mudule sacred #8

Closed cjing9017 closed 5 years ago

cjing9017 commented 5 years ago

I ran on the Window10 system, but the following problem:

(starcraft) E:\GitProject\pymarl>python src\main.py --config=qmix_smac --env-config=sc2 with env_args.map_name=2s3z [INFO 16:19:39] root Saving to FileStorageObserver in results/sacred. [DEBUG 16:19:41] pymarl Using capture mode "fd" [DEBUG 16:19:41] pymarl Stopping Heartbeat Exception originated from within Sacred. Traceback (most recent calls): File "D:\Downloads\Environment\Anaconda\envs\starcraft\lib\site-packages\sacred\stdout_capturing.py", line 131, in tee_output_fd ['tee', '-a', '/dev/stderr'], preexec_fn=os.setsid, AttributeError: module 'os' has no attribute 'setsid'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\Downloads\Environment\Anaconda\envs\starcraft\lib\site-packages\sacred\run.py", line 217, in call with capture_stdout() as self._output_file: File "D:\Downloads\Environment\Anaconda\envs\starcraft\lib\contextlib.py", line 81, in enter return next(self.gen) File "D:\Downloads\Environment\Anaconda\envs\starcraft\lib\site-packages\sacred\stdout_capturing.py", line 136, in tee_output_fd except (FileNotFoundError, (OSError, AttributeError)): TypeError: catching classes that do not inherit from BaseException is not allowed

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\Downloads\Environment\Anaconda\envs\starcraft\lib\site-packages\sacred\run.py", line 344, in _stop_time seconds=round((self.stop_time - self.start_time).total_seconds())) TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'NoneType'

Greg-Farquhar commented 5 years ago

This looks like a bug in Sacred with Windows at https://github.com/IDSIA/sacred/blob/master/sacred/stdout_capturing.py#L139. Can you go to that file -- locally for you it will be "D:\Downloads\Environment\Anaconda\envs\starcraft\lib\site-packages\sacred\stdout_capturing.py" and change the line 136 except (FileNotFoundError, (OSError, AttributeError)): to except (FileNotFoundError, OSError, AttributeError): ? If that works, you or I can make a PR to sacred to fix it.

GuoZoneDUT commented 5 years ago

I ran on the Window10 system, but the following problem:

(starcraft) E:\GitProject\pymarl>python src\main.py --config=qmix_smac --env-config=sc2 with env_args.map_name=2s3z [INFO 16:19:39] root Saving to FileStorageObserver in results/sacred. [DEBUG 16:19:41] pymarl Using capture mode "fd" [DEBUG 16:19:41] pymarl Stopping Heartbeat Exception originated from within Sacred. Traceback (most recent calls): File "D:\Downloads\Environment\Anaconda\envs\starcraft\lib\site-packages\sacred\stdout_capturing.py", line 131, in tee_output_fd ['tee', '-a', '/dev/stderr'], preexec_fn=os.setsid, AttributeError: module 'os' has no attribute 'setsid'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\Downloads\Environment\Anaconda\envs\starcraft\lib\site-packages\sacred\run.py", line 217, in call with capture_stdout() as self._output_file: File "D:\Downloads\Environment\Anaconda\envs\starcraft\lib\contextlib.py", line 81, in enter return next(self.gen) File "D:\Downloads\Environment\Anaconda\envs\starcraft\lib\site-packages\sacred\stdout_capturing.py", line 136, in tee_output_fd except (FileNotFoundError, (OSError, AttributeError)): TypeError: catching classes that do not inherit from BaseException is not allowed

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\Downloads\Environment\Anaconda\envs\starcraft\lib\site-packages\sacred\run.py", line 344, in _stop_time seconds=round((self.stop_time - self.start_time).total_seconds())) TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'NoneType'

HI,how do you use this framework in windows?Can you help me?I don't know how to run this in the windows?Thanks!

Greg-Farquhar commented 5 years ago

Can you try making the change I suggested above in your file D:\Downloads\Environment\Anaconda\envs\starcraft\lib\site-packages\sacred\stdout_capturing.py

BCWang93 commented 5 years ago

Can you try making the change I suggested above in your file D:\Downloads\Environment\Anaconda\envs\starcraft\lib\site-packages\sacred\stdout_capturing.py

Hi,can you tell me how to solve this?And how to make a change in you said the file?Thank you very much

cjing9017 commented 5 years ago

This looks like a bug in Sacred with Windows at https://github.com/IDSIA/sacred/blob/master/sacred/stdout_capturing.py#L139. Can you go to that file -- locally for you it will be "D:\Downloads\Environment\Anaconda\envs\starcraft\lib\site-packages\sacred\stdout_capturing.py" and change the line 136 except (FileNotFoundError, (OSError, AttributeError)): to except (FileNotFoundError, OSError, AttributeError): ? If that works, you or I can make a PR to sacred to fix it.

sorry! I seen it so late. But I can through the way by you provided modify the stdout_capturing.py to run it, thanks!

cjing9017 commented 5 years ago

Can you try making the change I suggested above in your file D:\Downloads\Environment\Anaconda\envs\starcraft\lib\site-packages\sacred\stdout_capturing.py

Hi,can you tell me how to solve this?And how to make a change in you said the file?Thank you very much

you can modify the file stdout_capturing.py, which located in the module of sacred. To change "except (FileNotFoundError, (OSError, AttributeError)):" to "except (FileNotFoundError, OSError, AttributeError):"

Greg-Farquhar commented 5 years ago

I've made a PR to fix it with sacred https://github.com/IDSIA/sacred/pull/461