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

Tensorflow 2.16.1 compatibility #38

Open
Stikus opened this issue Mar 15, 2024 · 1 comment
Open

Tensorflow 2.16.1 compatibility #38

Stikus opened this issue Mar 15, 2024 · 1 comment

Comments

@Stikus
Copy link

Stikus commented Mar 15, 2024

Hello, as you can see in pVACtools issue griffithlab/pVACtools#1084 - https://github.com/openvax/mhcflurry and mhcnuggets doesn't work with latest 2.16.1 version of tensorflow.

Exception: An error occurred while calling MHCnuggets:
/usr/local/lib/python3.10/dist-packages/keras/src/layers/core/masking.py:47: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(**kwargs)
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/pvactools/lib/call_mhcnuggets.py", line 84, in <module>
    main()
  File "/usr/local/lib/python3.10/dist-packages/pvactools/lib/call_mhcnuggets.py", line 61, in main
    predict(args.class_type, tmp_file.name, mhcnuggets_allele(args.allele, args.class_type), output=tmp_output_file.name, rank_output=True)
  File "/usr/local/lib/python3.10/dist-packages/mhcnuggets/src/predict.py", line 93, in predict
    model.compile(loss='mse', optimizer=Adam(lr=0.001))
  File "/usr/local/lib/python3.10/dist-packages/keras/src/optimizers/adam.py", line 60, in __init__
    super().__init__(
  File "/usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/optimizer.py", line 19, in __init__
    super().__init__(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/keras/src/optimizers/base_optimizer.py", line 38, in __init__
    raise ValueError(f"Argument(s) not recognized: {kwargs}")
ValueError: Argument(s) not recognized: {'lr': 0.001}

Looks like some legacy code stopped working:
https://github.com/KarchinLab/mhcnuggets/blob/master/mhcnuggets/src/predict.py#L90-L93

Maybe tensorflow version should be pinned until code is fixed?

Similar openvax/mhcflurry#234 issue.

@indapa
Copy link

indapa commented Jun 28, 2024

I was facing the same issue. Should I install another version of TensorFlow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants