elix-tech / kmol

kMoL is a machine learning library for drug discovery and life sciences, with federated learning capabilities.
MIT License
36 stars 6 forks source link

How to solve the trial failed because of target size input and output is different? #10

Closed eljalaludin closed 1 year ago

eljalaludin commented 1 year ago

I am trying to run a multi-task learning model using the CYPs dataset.

},
"loader": {
    "type": "csv",
    "input_path": "/opt/elix/kmol/data/data/20230823_multi_all.csv",
    "input_column_names": ["smiles"],
    "target_column_names": ["1A2", "2B6", "2C8", "2C9", "2C19", "2D6", "2E1", "3A4"]
},
"splitter": {
    "type": "descriptor",
    "descriptor": "MolWt",
    "splits": {"train": 0.8, "validation": 0.1, "test": 0.1},
    "seed": 63,
    "bins_count": 10

But, whenever I ran the script, it resulted in the same error.

0:00:01 | 2023-10-05 06:46:16 | [ INFO  | helpers.py:204] > Dataset Cache Key: 63b309d3e0e19722ca9d6e8e5f547832 0:00:01 | 2023-10-05 06:46:16 | [ INFO  | preprocessor.py:220] > Starting featurization... All jobs progress: 笏≫煤笏≫煤笏≫煤笏≫煤笏≫煤笏≫煤笏≫煤笏≫煤笏≫煤笏≫煤笏≫煤笏≫煤笏≫煤笏≫煤笏≫煤笏≫煤笏≫煤笏≫煤 5/5 100% 0:00:00 0:01:30 Epoch 1 | Train Loss: 0.00000 0/53 0% -:--:-- 0:00:01 0:02:23 | 2023-10-05 06:48:37 | [ ERROR  | run.py:71] > [Trial Failed] Target size (torch.Size([192, 8])) must be the same as input size (torch.Size([192, 5])) 0:02:23 | 2023-10-05 06:48:37 | [ INFO  | helpers.py:204] > Dataset Cache Key: 63b309d3e0e19722ca9d6e8e5f547832 Epoch 1 | Train Loss: 0.00000 0/159 0% -:--:-- 0:00:00 0:02:39 | 2023-10-05 06:48:54 | [ ERROR  | run.py:71] > [Trial Failed] Target size (torch.Size([64, 8])) must be the same as input size (torch.Size([64, 5])) 0:02:40 | 2023-10-05 06:48:54 | [ INFO  | helpers.py:204] > Dataset Cache Key: 63b309d3e0e19722ca9d6e8e5f547832 Epoch 1 | Train Loss: 0.00000 0/80 0% -:--:-- 0:00:00

Do you have any idea why this happened?