Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enzeptional No Unmasking model loaded. #236

Closed
Allostelic opened this issue Apr 17, 2024 · 4 comments
Closed

Enzeptional No Unmasking model loaded. #236

Allostelic opened this issue Apr 17, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Allostelic
Copy link

I encountered an error while running the example_enzeptional.py script, which prevents the unmasking model from being loaded correctly. This issue seems to affect the optimization process, as the algorithm cannot effectively perform due to the missing model component.

The script fails to load the unmasking model and outputs the following error message:

ERROR:gt4sd.frameworks.enzeptional.processing: No Unmasking model loaded. Check your model inputs

It seems there might be a misconfiguration or path issue that prevents the unmasking model from being recognized by the system. Verifying the paths and configurations in the mutation_config might provide a solution.

@Allostelic Allostelic added the bug Something isn't working label Apr 17, 2024
@Allostelic Allostelic changed the title nzeptional No Unmasking model loaded. Enzeptional No Unmasking model loaded. Apr 17, 2024
@drugilsberg
Copy link
Contributor

@Allostelic thanks for reporting this. @yvesnana the main maintainer is currently on holiday, but we will look into it as soon as he is back the coming week.

@yvesnana
Copy link
Contributor

@Allostelic thank you for reporting this. I've looked into this and performed some tests on my end, and everything seems to be working correctly. However, to better understand and resolve the problem you're facing, I'd appreciate if you could provide me with a few more details: What operating system are you using (e.g., Windows, macOS, Linux)? and Can you please share the full traceback of the error message you're encountering? This will help me better understand the context of the issue.

@Allostelic
Copy link
Author

Allostelic commented Apr 24, 2024

Thank you for your reply.
I have created and installed a new environment using Linux Anaconda.
I was also interested in Kcat, so I followed the README, modified the folder in line 13 of Example_enzeptional.py from feasibility to kcat and ran the script.
As a result, several errors appeared.

In case you are wondering, the array optimisation could be executed as it was with feasibility.

The errors are as follows.
I tried it with several XGBoost versions, but none of them worked.

Some weights of EsmModel were not initialized from the model checkpoint at facebook/esm2_t33_650M_UR50D and are newly initialized: ['esm.pooler.dense.weight', 'esm.pooler.dense.bias']
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
ERROR:gt4sd.frameworks.enzeptional.processing:No Unmasking model loaded. Check you model inputs
Some weights of the model checkpoint at facebook/esm2_t33_650M_UR50D were not used when initializing EsmForMaskedLM: ['esm.contact_head.regression.bias', 'esm.contact_head.regression.weight']

  • This IS expected if you are initializing EsmForMaskedLM from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
  • This IS NOT expected if you are initializing EsmForMaskedLM from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
    Some weights of EsmForMaskedLM were not initialized from the model checkpoint at facebook/esm2_t33_650M_UR50D and are newly initialized: ['lm_head.decoder.weight']
    You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
    Traceback (most recent call last):
    File "example_enzeptional.py", line 87, in
    main()
    File "example_enzeptional.py", line 79, in main
    optimizer = setup_optimizer(
    File "example_enzeptional.py", line 60, in setup_optimizer
    return EnzymeOptimizer(**optimizer_config)
    File "/home//anaconda3/envs/gt4sd/lib/python3.8/site-packages/gt4sd/frameworks/enzeptional/core.py", line 409, in init
    self.scorer = load(scorer_filepath)
    File "/home//anaconda3/envs/gt4sd/lib/python3.8/site-packages/joblib/numpy_pickle.py", line 658, in load
    obj = _unpickle(fobj, filename, mmap_mode)
    File "/home//anaconda3/envs/gt4sd/lib/python3.8/site-packages/joblib/numpy_pickle.py", line 577, in _unpickle
    obj = unpickler.load()
    File "/home//anaconda3/envs/gt4sd/lib/python3.8/pickle.py", line 1212, in load
    dispatchkey[0]
    File "/home//anaconda3/envs/gt4sd/lib/python3.8/site-packages/joblib/numpy_pickle.py", line 402, in load_build
    Unpickler.load_build(self)
    File "/home//anaconda3/envs/gt4sd/lib/python3.8/pickle.py", line 1705, in load_build
    setstate(state)
    File "/home//anaconda3/envs/gt4sd/lib/python3.8/site-packages/xgboost/core.py", line 1266, in setstate
    _check_call(
    File "/home//anaconda3/envs/gt4sd/lib/python3.8/site-packages/xgboost/core.py", line 210, in _check_call
    raise XGBoostError(py_str(_LIB.XGBGetLastError()))
    xgboost.core.XGBoostError: [06:11:09] ../src/common/json.cc:458: Expecting: """, got: "76 ", around character position: 1
    {L\0\0\0\0\0\0\0
    ^~~~~~~~~
    Stack trace:
    [bt] (0) /home//anaconda3/envs/gt4sd/lib/python3.8/site-packages/xgboost/lib/libxgboost.so(+0x912df) [0x7f422d8d72df]
    [bt] (1) /home//anaconda3/envs/gt4sd/lib/python3.8/site-packages/xgboost/lib/libxgboost.so(+0xc0fc0) [0x7f422d906fc0]
    [bt] (2) /home//anaconda3/envs/gt4sd/lib/python3.8/site-packages/xgboost/lib/libxgboost.so(+0xc6b5e) [0x7f422d90cb5e]
    [bt] (3) /home//anaconda3/envs/gt4sd/lib/python3.8/site-packages/xgboost/lib/libxgboost.so(+0xc1efc) [0x7f422d907efc]
    [bt] (4) /home//anaconda3/envs/gt4sd/lib/python3.8/site-packages/xgboost/lib/libxgboost.so(+0xc1fbe) [0x7f422d907fbe]
    [bt] (5) /home//anaconda3/envs/gt4sd/lib/python3.8/site-packages/xgboost/lib/libxgboost.so(+0x1d2fae) [0x7f422da18fae]
    [bt] (6) /home//anaconda3/envs/gt4sd/lib/python3.8/site-packages/xgboost/lib/libxgboost.so(XGBoosterUnserializeFromBuffer+0x45) [0x7f422d8c5ca5]
    [bt] (7) /home//anaconda3/envs/gt4sd/lib/python3.8/lib-dynload/../../libffi.so.8(+0x6a4a) [0x7f437888aa4a]
    [bt] (8) /home//anaconda3/envs/gt4sd/lib/python3.8/lib-dynload/../../libffi.so.8(+0x5fea) [0x7f4378889fea]

@yvesnana
Copy link
Contributor

@Allostelic
Thank you for your detailed report on the issues you encountered while running the Example_enzeptional.py script. I have addressed these problems and updated the example file as well as Enzeptional's core.py module.

The file now correctly handles the Kcat functionality and should run without the errors you previously encountered. Please feel free to try the updated example script and let me know if you encounter any further problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants