Skip to content

Commit

Permalink
Fix remaining instance of ValueError when numerics not cast as float6…
Browse files Browse the repository at this point in the history
…4s, and increase minor version number for new release.

PiperOrigin-RevId: 243966695
  • Loading branch information
psc-g committed Apr 17, 2019
1 parent 834c4b8 commit 01abb82
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions dopamine/colab/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def load_baselines(base_dir, verbose=False):
single_agent_data[field_name] = (
single_agent_data[field_name].astype(np.float64))
except ValueError:
# This will catch any non-numerics that cannot be cast to float64.
continue
if game in experimental_data:
experimental_data[game] = experimental_data[game].merge(
Expand Down Expand Up @@ -285,5 +286,15 @@ def read_experiment(log_path,

row_index += 1

# The dataframe rows are all read as 'objects', which causes a
# ValueError when merging below. We cast the numerics to float64s to
# avoid this.
for field_name in data_frame.keys():
try:
data_frame[field_name] = data_frame[field_name].astype(np.float64)
except ValueError:
# This will catch any non-numerics that cannot be cast to float64.
continue

# Shed any unused rows.
return data_frame.drop(np.arange(row_index, expected_num_rows))
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

setup(
name='dopamine_rl',
version='2.0.2',
version='2.0.3',
include_package_data=True,
packages=find_packages(exclude=['docs']), # Required
package_data={'testdata': ['testdata/*.gin']},
Expand Down

0 comments on commit 01abb82

Please sign in to comment.