janosh / matbench-discovery

An evaluation framework for machine learning models simulating high-throughput materials discovery.
https://matbench-discovery.materialsproject.org
MIT License
90 stars 12 forks source link

df_wbm has wrong index column name type for wandb.Table #81

Closed pbenner closed 7 months ago

pbenner commented 7 months ago

Running test_mace.py currently fails with the following error:

Relaxing: 100%|██████████| 257/257 [13:10:57<00:00, 184.66s/it]  
Traceback (most recent call last):
  File "/home/pbenner/Source/tmp/matbench-discovery-pbenner/models/mace/test_mace.py", line 168, in <module>
    table = wandb.Table(
            ^^^^^^^^^^^^
  File "/home/pbenner/.local/opt/anaconda3/envs/mace/lib/python3.11/site-packages/wandb/data_types.py", line 281, in __init__
    self._init_from_dataframe(dataframe, columns, optional, dtype)
  File "/home/pbenner/.local/opt/anaconda3/envs/mace/lib/python3.11/site-packages/wandb/data_types.py", line 334, in _init_from_dataframe
    self._assert_valid_columns(columns)
  File "/home/pbenner/.local/opt/anaconda3/envs/mace/lib/python3.11/site-packages/wandb/data_types.py", line 304, in _assert_valid_columns
    assert len(columns) == 0 or all(
           ^^^^^^^^^^^^^^^^^
AssertionError: columns argument expects list of strings or ints

https://github.com/janosh/matbench-discovery/blob/31183303257ab0275f42ee000345b45036b077c1/models/mace/test_mace.py#L167

A simple bugfix is the following:

df_wbm.index.name = str(df_wbm.index.name)

i.e. the index column name has type enum 'Key', which is not accepted by wandb.

janosh commented 7 months ago

thanks for reporting! 👍

janosh commented 7 months ago

fixed in https://github.com/janosh/matbench-discovery/pull/82 but forgot to close here after