ku-cbd / PhageBoost

Rapid discovery of novel prophages using biological feature engineering and machine learning
GNU General Public License v3.0
35 stars 6 forks source link

Failure at read_model_from_file #15

Closed chartl-rancho closed 3 years ago

chartl-rancho commented 3 years ago

I am attempting to run PhageBoost from within docker; and read_model_from_file is apparently returning a 'None' value for feats.

Dockerfile:

FROM continuumio/miniconda3
RUN apt-get update --fix-missing
RUN apt-get upgrade --yes

RUN apt-get install --yes  git 

RUN git clone https://github.com/ku-cbd/PhageBoost.git
RUN conda create --name PhageBoostEnv python=3.7

RUN echo "conda activate PhageBoostEnv" >> ~/.bashrc
SHELL ["/bin/bash", "--login", "-c"]

RUN cd PhageBoost && python setup.py bdist_wheel && python setup.py install --user

RUN echo "#!/bin/bash --login" > phageboost && echo "set -e -x -v -o pipefail" >> phageboost && echo "python --version" >> phageboost && echo "python ~/.local/bin/PhageBoost \$@" >> phageboost
RUN chmod 777 phageboost 
RUN cat phageboost
RUN cp phageboost /bin

Call and output:

$ sudo docker run -v `pwd`:/out phageboost:0.1 phageboost -f /PhageBoost/example/data/NC_000907.fasta.gz -o /out/results
python --version
+ python --version
Python 3.7.10
python ~/.local/bin/PhageBoost $@
+ python /root/.local/bin/PhageBoost -f /PhageBoost/example/data/NC_000907.fasta.gz -o /out/results
processing: NC_000907
time after genecalls: 5.103323459625244
time after feature calculations: 20.567537307739258
[05:05:49] WARNING: ../src/tree/./updater_quantile_hist.h:137: Attempted to load internal configuration for a model file that was generated by a previous version of XGBoost. A likely cause for this warni
ng is that the model was saved with saveRDS() in R or pickle.dump() in Python. We strongly ADVISE AGAINST using saveRDS() or pickle.dump() so that the model remains accessible in current and upcoming XGB
oost releases. Please use xgb.save() instead to preserve models for the long term. For more details and explanation, see https://xgboost.readthedocs.io/en/latest/tutorials/saving_model.html
Traceback (most recent call last):
  File "/root/.local/bin/PhageBoost", line 33, in <module>
    sys.exit(load_entry_point('PhageBoost==0.1.7', 'console_scripts', 'PhageBoost')())
  File "/root/.local/lib/python3.7/site-packages/PhageBoost-0.1.7-py3.7.egg/PhageBoost/main.py", line 223, in main
    model, feats, feats_, limit = read_model_from_file(model_file)
  File "/root/.local/lib/python3.7/site-packages/PhageBoost-0.1.7-py3.7.egg/PhageBoost/main.py", line 65, in read_model_from_file
    feats_ = [i.replace('-delta', '') for i in feats]
TypeError: 'NoneType' object is not iterable
zheminzhou commented 3 years ago

I solved the problem by downgrading xgboost to version 1.3.3