未验证 提交 0915559a 编写于 作者: Z Zheyue Tan 提交者: GitHub

fix auto set dir (#360)

上级 a7ac16df
......@@ -170,7 +170,10 @@ def auto_set_dir(action=None):
dirname(str): log directory used in the global logging directory.
"""
mod = sys.modules['__main__']
basename = os.path.basename(mod.__file__)
if hasattr(mod, '__file__'):
basename = os.path.basename(mod.__file__)
else:
basename = ''
dirname = os.path.join('train_log', basename[:basename.rfind('.')])
dirname = os.path.normpath(dirname)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册