stable-baselines icon indicating copy to clipboard operation
stable-baselines copied to clipboard

Using Callback: Monitoring Training with multiProcessing

Open soloist96 opened this issue 7 years ago • 1 comments

Hi, I followed the examples provided by the documentation about multiprocessing and monitoring training separately and they worked well. However, when I tried to combine them two, the plot_results() function provided in the example crashed and had the following error related to loading the monitor.csv file:

ParserError Traceback (most recent call last) in 1 # parallel results ----> 2 plot_results(log_dir)

in plot_results(log_folder, title) 17 :param title: (str) the title of the task to plot 18 """ ---> 19 x, y = ts2xy(load_results(log_folder), 'timesteps') 20 y = moving_average(y, window=50) 21 # Truncate x

~/.conda/envs/openai/lib/python3.6/site-packages/stable_baselines/bench/monitor.py in load_results(path) 178 assert first_line[0] == '#' 179 header = json.loads(first_line[1:]) --> 180 data_frame = pandas.read_csv(file_handler, index_col=None) 181 headers.append(header) 182 elif file_name.endswith('json'): # Deprecated json format

~/.conda/envs/openai/lib/python3.6/site-packages/pandas/io/parsers.py in parser_f(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, dialect, tupleize_cols, error_bad_lines, warn_bad_lines, delim_whitespace, low_memory, memory_map, float_precision) 700 skip_blank_lines=skip_blank_lines) 701 --> 702 return _read(filepath_or_buffer, kwds) 703 704 parser_f.name = name

~/.conda/envs/openai/lib/python3.6/site-packages/pandas/io/parsers.py in _read(filepath_or_buffer, kwds) 433 434 try: --> 435 data = parser.read(nrows) 436 finally: 437 parser.close()

~/.conda/envs/openai/lib/python3.6/site-packages/pandas/io/parsers.py in read(self, nrows) 1137 def read(self, nrows=None): 1138 nrows = _validate_integer('nrows', nrows) -> 1139 ret = self._engine.read(nrows) 1140 1141 # May alter columns / col_dict

~/.conda/envs/openai/lib/python3.6/site-packages/pandas/io/parsers.py in read(self, nrows) 1993 def read(self, nrows=None): 1994 try: -> 1995 data = self._reader.read(nrows) 1996 except StopIteration: 1997 if self._first_chunk:

pandas/_libs/parsers.pyx in pandas._libs.parsers.TextReader.read()

pandas/_libs/parsers.pyx in pandas._libs.parsers.TextReader._read_low_memory()

pandas/_libs/parsers.pyx in pandas._libs.parsers.TextReader._read_rows()

pandas/_libs/parsers.pyx in pandas._libs.parsers.TextReader._tokenize_rows()

pandas/_libs/parsers.pyx in pandas._libs.parsers.raise_parser_error()

ParserError: Error tokenizing data. C error: Expected 9 fields in line 4, saw 15

It seems that the monitor.csv file has more columns when running multi-processing than single processing. Is there any documentation about the content of monitor.csv and any suggestion on how to fix this will be appreciated.

Thank you.

soloist96 avatar Jul 18 '19 22:07 soloist96

Hello, Please fill in the issue template.

araffin avatar Jul 19 '19 04:07 araffin