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

建议在exception部分增加语句 #532

Closed
2 of 11 tasks
jaried opened this issue Nov 1, 2022 · 1 comment
Closed
2 of 11 tasks

建议在exception部分增加语句 #532

jaried opened this issue Nov 1, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@jaried
Copy link

jaried commented Nov 1, 2022

  • I have marked all applicable categories:
    • exception-raising bug
    • RL algorithm bug
    • system worker bug
    • system utils bug
    • code design/refactor
    • documentation request
    • new feature request
  • I have visited the readme and doc
  • I have searched through the issue tracker and pr tracker
  • I have mentioned version numbers, operating system and environment, where applicable:
  import ding, torch, sys
  print(ding.__version__, torch.__version__, sys.version, sys.platform)
v0.4.3 1.12.1+cu116 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)] win32

建议在exception部分增加语句,比原有的格式方便debug代码:

                print(traceback.format_exc())

我自己改的地方有:

except BaseException as e:
logging.warning("subprocess reset set seed failed, ignore and continue...")

except BaseException as e:
if self._retry_type == 'renew' or isinstance(e, pickle.UnpicklingError):
self._pipe_parents[env_id].close()
if self._subprocesses[env_id].is_alive():
self._subprocesses[env_id].terminate()
self._create_env_subprocess(env_id)
exceptions.append(e)
time.sleep(self._retry_waiting_time)

except Exception as e:
# when there are some errors in env, worker_fn will send the errors to env manager
# directly send error to another process will lose the stack trace, so we create a new Exception

except BaseException as e:
env.close()

except BaseException as e:
logging.debug("Sub env '{}' error when executing {}".format(str(env), cmd))
# when there are some errors in env, worker_fn will send the errors to env manager
# directly send error to another process will lose the stack trace, so we create a new Exception

@PaParaZz1 PaParaZz1 added the enhancement New feature or request label Nov 1, 2022
@zjowowen
Copy link
Collaborator

zjowowen commented Nov 1, 2022

Hi,
Thanks for your suggestions!
These updates will be added in the PR:
#534

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants