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

Problem with importing the predict module #37

Open
fenghua0811 opened this issue Jul 5, 2023 · 4 comments
Open

Problem with importing the predict module #37

fenghua0811 opened this issue Jul 5, 2023 · 4 comments

Comments

@fenghua0811
Copy link

Dear MHCnuggets maintainers,

When I install mhcnuggets,I use command
"from mhcnuggets.src.predict import predict"
show "bash: from: Command not found..."
then I use command
"which mhcnuggets.src.predict"
show "/usr/bin/which: no mhcnuggets.src.predict in ..."
What is the reason for this, is there a problem with which part of me?

Thanks
Faustina

@XiaoshanShao
Copy link
Contributor

All the example code we have are supposed to be operated in python not bash. Looks like you are trying to use python code in bash

@fenghua0811
Copy link
Author

Thanks for your help, looking at your other answers, I found that mhcnuggets needs to run when python=2, but when I install with pip in the environment of python=2.7 in conda, I will have the problem of low version:

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-wli8dl/biopython/
You are using pip version 9.0.1, however version 23.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Then I tried to download mhcnuggets at python=3 and copy it to python=2.7, and this problem occurred:

Python 2.7.18 |Anaconda, Inc.| (default, Jun  4 2021, 14:47:46) 
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from mhcnuggets.src.predict import predict
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "mhcnuggets/src/predict.py", line 10, in <module>
    import numpy as np
ImportError: No module named numpy

When I installed numpy, I found that I already had this module:

$ python2.7 -m pip install numpy
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Requirement already satisfied: numpy in /home/fenghua/software/envs/mhcnuggets/lib/python2.7/site-packages (1.24.3)
ERROR: Package 'numpy' requires a different Python: 2.7.18 not in '>=3.8'

Do you know what the reason is?

@XiaoshanShao
Copy link
Contributor

We have already updated all the codes to be used in python 3 environment, so you do not need to install it in the python 2.7 environment. If you want to run it in python 2.7, you will need use older versions of all dependencies, including numpy and tensorflow. And not sure what you mean by copying mhcnuggets to python 2.7, did you do a github download or pip install? I would strongly suggest you do a pip install.

@fenghua0811
Copy link
Author

When I

 from mhcnuggets.src.predict import predict

This situation has occurred

2023-07-17 11:04:20.390134: I tensorflow/core/util/port.cc:110] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2023-07-17 11:04:20.392739: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2023-07-17 11:04:20.445762: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2023-07-17 11:04:20.446367: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-07-17 11:04:21.066302: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT

After searching for tensort, I found that NVIDIA drivers are required, if I don't have an NVIDIA graphics card, is there any other way to use this software?

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