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

A Problem in --do_data #49

Open
CS18B opened this issue May 31, 2020 · 2 comments
Open

A Problem in --do_data #49

CS18B opened this issue May 31, 2020 · 2 comments

Comments

@CS18B
Copy link

CS18B commented May 31, 2020

When I do "python run_bert.py --do_data", I met this problem. My pytorch version is 1.5.0+cuda10.1

OSError: [Errno 22] Invalid argument: 'D:\\Desktop\\BERT+XLNET Multi-label\\pybert\\output\\log\\bert-2020-05-31-17:54:48.log'
The complete error message is shown below, is that because the log file is missing?

(pytorch_gpu) D:\Desktop\BERT+XLNET Multi-label>python run_bert.py --do_data Traceback (most recent call last): File "run_bert.py", line 216, in <module> main() File "run_bert.py", line 192, in main init_logger(log_file=config['log_dir'] / f'{args.arch}-{time.strftime("%Y-%m-%d-%H:%M:%S", time.localtime())}.log') File "D:\Desktop\BERT+XLNET Multi-label\pybert\common\tools.py", line 38, in init_logger file_handler = logging.FileHandler(log_file) File "D:\anaconda\anaconda1\envs\pytorch_gpu\lib\logging\__init__.py", line 1087, in __init__ StreamHandler.__init__(self, self._open()) File "D:\anaconda\anaconda1\envs\pytorch_gpu\lib\logging\__init__.py", line 1116, in _open return open(self.baseFilename, self.mode, encoding=self.encoding) OSError: [Errno 22] Invalid argument: 'D:\\Desktop\\BERT+XLNET Multi-label\\pybert\\output\\log\\bert-2020-05-31-17:54:48.log'

How to fix it? thx.

@voidzyc
Copy link

voidzyc commented Jun 1, 2020

My way to solve this problem is modify ":" into "_" or any other character in run_bert.py, line 192
init_logger(log_file=config['log_dir'] / f'{args.arch}-{time.strftime("%Y-%m-%d-%H_%M_%S", time.localtime())}.log')
I think this problem is caused by ":" but I don't know why.

@CS18B
Copy link
Author

CS18B commented Jun 9, 2020

My way to solve this problem is modify ":" into "_" or any other character in run_bert.py, line 192
init_logger(log_file=config['log_dir'] / f'{args.arch}-{time.strftime("%Y-%m-%d-%H_%M_%S", time.localtime())}.log')
I think this problem is caused by ":" but I don't know why.

It works! thank you so much!😀

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

No branches or pull requests

2 participants