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

Test module falling after installation #38

Open
geboro opened this issue Jul 26, 2022 · 4 comments
Open

Test module falling after installation #38

geboro opened this issue Jul 26, 2022 · 4 comments

Comments

@geboro
Copy link

geboro commented Jul 26, 2022

DeepVirFinder isn't working in Ubuntu 20.04 after installing dependencies succesfully...

(dvf)$ python dvf.py -i ./test/crAssphage.fa -o ./test/ -l 300
Using Theano backend.
WARNING (theano.configdefaults): install mkl with `conda install mkl-service`: No module named 'mkl'
1. Loading Models.
   model directory /raw_data/DeepVirFinder/models
Traceback (most recent call last):
  File "dvf.py", line 131, in <module>
    modDict[contigLengthk] = load_model(os.path.join(modDir, modName))
  File "/opt/anaconda/envs/dvf/lib/python3.6/site-packages/keras/engine/saving.py", line 419, in load_model
    model = _deserialize_model(f, custom_objects, compile)
  File "/opt/anaconda/envs/dvf/lib/python3.6/site-packages/keras/engine/saving.py", line 224, in _deserialize_model
    model_config = json.loads(model_config.decode('utf-8'))
AttributeError: 'str' object has no attribute 'decode'

and after installing mkl-service...

(dvf) $ conda install mkl-service
(dvf) $ python3.6 dvf.py -i ./test/crAssphage.fa -o ./test/ -l 300
Using Theano backend.
1. Loading Models.
   model directory /soft/DeepVirFinder/models
Traceback (most recent call last):
  File "dvf.py", line 131, in <module>
    modDict[contigLengthk] = load_model(os.path.join(modDir, modName))
  File "/opt/anaconda/envs/dvf/lib/python3.6/site-packages/keras/engine/saving.py", line 419, in load_model
    model = _deserialize_model(f, custom_objects, compile)
  File "/opt/anaconda/envs/dvf/lib/python3.6/site-packages/keras/engine/saving.py", line 224, in _deserialize_model
    model_config = json.loads(model_config.decode('utf-8'))
AttributeError: 'str' object has no attribute 'decode'

Any idea of what's going on here?

@dnolin13
Copy link

dnolin13 commented Jul 27, 2022

I am having the same issue!

(dvf) delaney@ada:~/software/DeepVirFinder$ ls dvf.py encode.py licence.md models README.md supplementary_tables test train_example training.py (dvf) delaney@ada:~/software/DeepVirFinder$ python dvf.py -i ./test/crAssphage.fa -o ./test/ -l 300 Using Theano backend. WARNING (theano.configdefaults): install mkl with conda install mkl-service`: No module named 'mkl'

  1. Loading Models.
    model directory /home/delaney/software/DeepVirFinder/models
    Traceback (most recent call last):
    File "dvf.py", line 131, in
    modDict[contigLengthk] = load_model(os.path.join(modDir, modName))
    File "/home/delaney/miniconda3/envs/dvf/lib/python3.6/site-packages/keras/engine/saving.py", line 419, in load_model
    model = _deserialize_model(f, custom_objects, compile)
    File "/home/delaney/miniconda3/envs/dvf/lib/python3.6/site-packages/keras/engine/saving.py", line 224, in _deserialize_model
    model_config = json.loads(model_config.decode('utf-8'))
    AttributeError: 'str' object has no attribute 'decode'
    (dvf) delaney@ada:~/software/DeepVirFinder$
    `

@TomasaSbaffi
Copy link

I also have the same issue, I am trying to install the packages in different orders but with no actual rationale behind.
It should be due to issues with dependencies:
https://stackoverflow.com/questions/53740577/does-any-one-got-attributeerror-str-object-has-no-attribute-decode-whi

@TomasaSbaffi
Copy link

I solved it with the following:

conda activate dvf
pip3 uninstall keras
pip3 uninstall tensorflow
pip3 uninstall h5py

pip3 install 'h5py==2.10.0' --force-reinstall
pip3 install 'tensorflow==2.4.1'
pip3 install 'keras==2.2.4'

I do believe the real problem for me was the version of TF, the older version installed with the instructions given was not working nor the new versions, but a middle ground version did work.
h5py and keras are reinstalled as per instructions so I am not sure if uninstalling them and re installing them actually helped.
I still do not know why but this worked fine for me. I hope it helps.

@fluhus
Copy link

fluhus commented Sep 12, 2022

Thanks @TomasaSbaffi, your response helped me solve the issue. Reinstalling h5py with the version you mentioned was enough in my case.

@jessieren perhaps the instructions for creating the conda env should be updated with h5py=2.10.0?

Edit: I can confirm that when I create the environment with conda create --name dvf numpy theano=1.0.3 keras=2.2.4 scikit-learn Biopython h5py=2.10.0 it works out of the box.

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

4 participants