Skip to content

Unpickling error when loading GDSC1 #357

Open
@abearab

Description

@abearab

Describe the bug
similar to #306

To Reproduce

from tdc.multi_pred import DrugRes
GDSC1 = DrugRes(name = 'GDSC1')
---------------------------------------------------------------------------
UnpicklingError                           Traceback (most recent call last)
Cell In[18], line 1
----> 1 GDSC1 = DrugRes(name = 'GDSC1')
      2 # GDSC2 = DrugRes(name = 'GDSC2')

File ~/anaconda3/envs/scez/lib/python3.11/site-packages/tdc/multi_pred/drugres.py:35, in DrugRes.__init__(self, name, path, label_name, print_stats)
     33 def __init__(self, name, path="./data", label_name=None, print_stats=False):
     34     """Create Drug Response Prediction dataloader object"""
---> 35     super().__init__(name,
     36                      path,
     37                      label_name,
     38                      print_stats,
     39                      dataset_names=dataset_names["DrugRes"])
     40     self.entity1_name = "Drug"
     41     self.entity2_name = "Cell Line"

File ~/anaconda3/envs/scez/lib/python3.11/site-packages/tdc/multi_pred/bi_pred_dataset.py:70, in DataLoader.__init__(self, name, path, label_name, print_stats, dataset_names, data_config)
     66 else:
     67     aux_column = None
     69 (entity1, entity2, raw_y, entity1_idx, entity2_idx, aux_column_val, df,
---> 70  augment_df) = interaction_dataset_load(name,
     71                                         path,
     72                                         label_name,
     73                                         dataset_names,
     74                                         aux_column=aux_column,
     75                                         data_config=data_config)
     77 self.name = name
     78 self.entity1 = entity1

File ~/anaconda3/envs/scez/lib/python3.11/site-packages/tdc/utils/load.py:462, in interaction_dataset_load(name, path, target, dataset_names, aux_column, data_config)
    460 name = download_wrapper(name, path, dataset_names)
    461 print_sys("Loading...")
--> 462 df = pd_load(name, path)
    463 if data_config is not None:
    464     # code block to apply preprocessing rules defined by config files
    465     process_callback = data_config.processing_callback

File ~/anaconda3/envs/scez/lib/python3.11/site-packages/tdc/utils/load.py:301, in pd_load(name, path)
    299     df = pd.read_excel(os.path.join(path, name + "." + name2type[name]))
    300 elif name2type[name] == "pkl":
--> 301     df = pd.read_pickle(os.path.join(path,
    302                                      name + "." + name2type[name]))
    303 elif name2type[name] == "zip":
    304     df = pd.read_pickle(os.path.join(path, name + "/" + name + ".pkl"))

File ~/anaconda3/envs/scez/lib/python3.11/site-packages/pandas/io/pickle.py:202, in read_pickle(filepath_or_buffer, compression, storage_options)
    199     with warnings.catch_warnings(record=True):
    200         # We want to silence any warnings about, e.g. moved modules.
    201         warnings.simplefilter("ignore", Warning)
--> 202         return pickle.load(handles.handle)
    203 except excs_to_catch:
    204     # e.g.
    205     #  "No module named 'pandas.core.sparse.series'"
    206     #  "Can't get attribute '__nat_unpickle' on <module 'pandas._libs.tslib"
    207     return pc.load(handles.handle, encoding=None)

UnpicklingError: invalid load key, '<'.

Environment:

  • OS: linux
  • Python version: python3.11
  • TDC version: 1.1.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions