apcamargo / genomad

geNomad: Identification of mobile genetic elements
https://portal.nersc.gov/genomad/
Other
169 stars 17 forks source link

ValueError: Cannot convert '5997' to a shape. #83

Closed WUD2018 closed 3 months ago

WUD2018 commented 3 months ago

Hey developer,

Thanks for your efforts to develop this tool.

I have successfully installed the genomad via mamba:

mamba create -n genomad -c conda-forge -c bioconda genomad

and

genomad download-database .

However, when the pipelines run to 'Encoding' sequences: an issue jumps out as below. Could you please help me out?

......
[00:53:25] geNomad marker-classification finished!
╭──────────────────────────────────────────────────────────────────────────────╮ │ Executing geNomad nn-classification (v1.7.5). This will classify the input │ │ sequences into chromosome, plasmid, or virus based on the nucleotide │ │ sequence. │ │ ────────────────────────────────────────────────────────────────────────── │ │ Outputs: │ │ genomad_output/AnimFece_bin.1_nn_classification │ │ ├── AnimFece_bin.1_nn_classification.json (execution parameters) │ │ ├── AnimFece_bin.1_encoded_sequences (directory containing encoded │ │ │ sequence data) │ │ ├── AnimFece_bin.1_nn_classification.tsv (contig classification: tabular │ │ │ format) │ │ └── AnimFece_bin.1_nn_classification.npz (contig classification: binary │ │ format) │ ╰──────────────────────────────────────────────────────────────────────────────╯ [00:53:27] Executing genomad nn-classification.
[00:53:27] Creating the genomad_output/AnimFece_bin.1_nn_classification
directory.
[00:53:27] Creating the
genomad_output/AnimFece_bin.1_nn_classification/AnimFece_bin.1_encode d_sequences directory.
[00:53:28] Encoded sequence data written to AnimFece_bin.1_encoded_sequences.

Traceback (most recent call last): File "/home/dell/anaconda3/envs/genomad/bin/genomad", line 10, in sys.exit(cli()) File "/home/dell/anaconda3/envs/genomad/lib/python3.10/site-packages/click/core.py", line 1157, in call return self.main(args, kwargs) File "/home/dell/.local/lib/python3.10/site-packages/rich_click/rich_command.py", line 126, in main rv = self.invoke(ctx) File "/home/dell/anaconda3/envs/genomad/lib/python3.10/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/dell/anaconda3/envs/genomad/lib/python3.10/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/dell/anaconda3/envs/genomad/lib/python3.10/site-packages/click/core.py", line 783, in invoke return __callback(args, kwargs) File "/home/dell/anaconda3/envs/genomad/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func return f(get_current_context(), *args, *kwargs) File "/home/dell/anaconda3/envs/genomad/lib/python3.10/site-packages/genomad/cli.py", line 1276, in end_to_end ctx.invoke( File "/home/dell/anaconda3/envs/genomad/lib/python3.10/site-packages/click/core.py", line 783, in invoke return __callback(args, kwargs) File "/home/dell/anaconda3/envs/genomad/lib/python3.10/site-packages/genomad/cli.py", line 719, in nn_classification genomad.nn_classification.main( File "/home/dell/anaconda3/envs/genomad/lib/python3.10/site-packages/genomad/modules/nn_classification.py", line 309, in main nn_model = neural_network.create_classifier() File "/home/dell/anaconda3/envs/genomad/lib/python3.10/site-packages/genomad/neural_network/model.py", line 34, in create_classifier encoder = create_encoder() File "/home/dell/anaconda3/envs/genomad/lib/python3.10/site-packages/genomad/neural_network/model.py", line 14, in create_encoder inputs = Input(shape=5_997, dtype="int64") File "/home/dell/.local/lib/python3.10/site-packages/keras/src/layers/core/input_layer.py", line 143, in Input layer = InputLayer( File "/home/dell/.local/lib/python3.10/site-packages/keras/src/layers/core/input_layer.py", line 46, in init shape = backend.standardize_shape(shape) File "/home/dell/.local/lib/python3.10/site-packages/keras/src/backend/common/variables.py", line 442, in standardize_shape raise ValueError(f"Cannot convert '{shape}' to a shape.") ValueError: Cannot convert '5997' to a shape.

Here is my conda list of genomad env:

packages in environment at /home/dell/anaconda3/envs/genomad:

#

Name Version Build Channel

_libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 2_gnu conda-forge _py-xgboost-mutex 2.0 cpu_0 conda-forge absl-py 2.1.0 pyhd8ed1ab_0 conda-forge aiohttp 3.9.3 py310h2372a71_1 conda-forge aiosignal 1.3.1 pyhd8ed1ab_0 conda-forge aragorn 1.2.41 h031d066_1 bioconda archspec 0.2.3 pyhd8ed1ab_0 conda-forge aria2 1.37.0 h347180d_1 conda-forge astunparse 1.6.3 pyhd8ed1ab_0 conda-forge async-timeout 4.0.3 pyhd8ed1ab_0 conda-forge attrs 23.2.0 pyh71513ae_0 conda-forge blinker 1.7.0 pyhd8ed1ab_0 conda-forge brotli-python 1.1.0 py310hc6cd4ac_1 conda-forge bzip2 1.0.8 hd590300_5 conda-forge c-ares 1.27.0 hd590300_0 conda-forge ca-certificates 2024.2.2 hbcca054_0 conda-forge cached-property 1.5.2 hd8ed1ab_1 conda-forge cached_property 1.5.2 pyha770c72_1 conda-forge cachetools 5.3.3 pyhd8ed1ab_0 conda-forge certifi 2024.2.2 pyhd8ed1ab_0 conda-forge cffi 1.16.0 py310h2fee648_0 conda-forge charset-normalizer 3.3.2 pyhd8ed1ab_0 conda-forge click 8.1.7 unix_pyh707e725_0 conda-forge cryptography 42.0.5 py310h75e40e8_0 conda-forge flatbuffers 23.5.26 h59595ed_1 conda-forge frozenlist 1.4.1 py310h2372a71_0 conda-forge gast 0.5.4 pyhd8ed1ab_0 conda-forge gawk 5.3.0 ha916aea_0 conda-forge genomad 1.7.5 pyhdfd78af_0 bioconda gettext 0.21.1 h27087fc_0 conda-forge giflib 5.2.1 h0b41bf4_3 conda-forge gmp 6.3.0 h59595ed_1 conda-forge google-auth 2.28.2 pyhca7485f_0 conda-forge google-auth-oauthlib 1.2.0 pyhd8ed1ab_0 conda-forge google-pasta 0.2.0 pyh8c360ce_0 conda-forge grpcio 1.59.3 py310h1b8f574_0 conda-forge h5py 3.10.0 nompi_py310h65828d5_101 conda-forge hdf5 1.14.3 nompi_h4f84152_100 conda-forge icu 73.2 h59595ed_0 conda-forge idna 3.6 pyhd8ed1ab_0 conda-forge importlib-metadata 7.0.2 pyha770c72_0 conda-forge joblib 1.3.2 pyhd8ed1ab_0 conda-forge keras 2.15.0 pyhd8ed1ab_0 conda-forge keyutils 1.6.1 h166bdaf_0 conda-forge krb5 1.21.2 h659d440_0 conda-forge ld_impl_linux-64 2.40 h41732ed_0 conda-forge libabseil 20230802.1 cxx17_h59595ed_0 conda-forge libaec 1.1.2 h59595ed_1 conda-forge libblas 3.9.0 21_linux64_openblas conda-forge libcblas 3.9.0 21_linux64_openblas conda-forge libcurl 8.6.0 hca28451_0 conda-forge libedit 3.1.20191231 he28a2e2_2 conda-forge libev 4.33 hd590300_2 conda-forge libffi 3.4.2 h7f98852_5 conda-forge libgcc-ng 13.2.0 h807b86a_5 conda-forge libgfortran-ng 13.2.0 h69a702a_5 conda-forge libgfortran5 13.2.0 ha4646dd_5 conda-forge libgomp 13.2.0 h807b86a_5 conda-forge libgrpc 1.59.3 hd6c4280_0 conda-forge libiconv 1.17 hd590300_2 conda-forge libidn2 2.3.7 hd590300_0 conda-forge libjpeg-turbo 3.0.0 hd590300_1 conda-forge liblapack 3.9.0 21_linux64_openblas conda-forge libllvm14 14.0.6 hcd5def8_4 conda-forge libnghttp2 1.58.0 h47da74e_1 conda-forge libnsl 2.0.1 hd590300_0 conda-forge libopenblas 0.3.26 pthreads_h413a1c8_0 conda-forge libpng 1.6.43 h2797004_0 conda-forge libprotobuf 4.24.4 hf27288f_0 conda-forge libre2-11 2023.09.01 h7a70373_1 conda-forge libsqlite 3.45.2 h2797004_0 conda-forge libssh2 1.11.0 h0841786_0 conda-forge libstdcxx-ng 13.2.0 h7e041cc_5 conda-forge libunistring 0.9.10 h7f98852_0 conda-forge libuuid 2.38.1 h0b41bf4_0 conda-forge libxcrypt 4.4.36 hd590300_1 conda-forge libxgboost 2.0.3 cpu_h6728c87_1 conda-forge libxml2 2.12.6 h232c23b_0 conda-forge libzlib 1.2.13 hd590300_5 conda-forge llvmlite 0.42.0 py310h1b8f574_1 conda-forge markdown 3.6 pyhd8ed1ab_0 conda-forge markdown-it-py 3.0.0 pyhd8ed1ab_0 conda-forge markupsafe 2.1.5 py310h2372a71_0 conda-forge mdurl 0.1.2 pyhd8ed1ab_0 conda-forge ml_dtypes 0.2.0 py310hcc13569_2 conda-forge mmseqs2 14.7e284 pl5321h6a68c12_2 bioconda mpfr 4.2.1 h9458935_0 conda-forge multidict 6.0.5 py310h2372a71_0 conda-forge ncurses 6.4 h59595ed_2 conda-forge numba 0.59.0 py310h7dc5dd1_1 conda-forge numpy 1.26.4 py310hb13e2d6_0 conda-forge oauthlib 3.2.2 pyhd8ed1ab_0 conda-forge openssl 3.2.1 hd590300_1 conda-forge opt_einsum 3.3.0 pyhc1e730c_2 conda-forge packaging 24.0 pyhd8ed1ab_0 conda-forge perl 5.32.1 7_hd590300_perl5 conda-forge pip 24.0 pyhd8ed1ab_0 conda-forge protobuf 4.24.4 py310h620c231_0 conda-forge py-xgboost 2.0.3 cpu_pyh0a621ce_1 conda-forge pyasn1 0.5.1 pyhd8ed1ab_0 conda-forge pyasn1-modules 0.3.0 pyhd8ed1ab_0 conda-forge pycparser 2.21 pyhd8ed1ab_0 conda-forge pygments 2.17.2 pyhd8ed1ab_0 conda-forge pyjwt 2.8.0 pyhd8ed1ab_1 conda-forge pyopenssl 24.0.0 pyhd8ed1ab_0 conda-forge pyrodigal 3.3.0 py310h4b81fae_1 bioconda pyrodigal-gv 0.3.1 pyh7cba7a3_0 bioconda pysocks 1.7.1 pyha2e5f31_6 conda-forge python 3.10.13 hd12c33a_1_cpython conda-forge python-crfsuite 0.9.9 py310hd41b1e2_2 conda-forge python-flatbuffers 24.3.7 pyh59ac667_0 conda-forge python_abi 3.10 4_cp310 conda-forge pyu2f 0.1.5 pyhd8ed1ab_0 conda-forge re2 2023.09.01 h7f4b329_1 conda-forge readline 8.2 h8228510_1 conda-forge requests 2.31.0 pyhd8ed1ab_0 conda-forge requests-oauthlib 1.4.0 pyhd8ed1ab_0 conda-forge rich 13.7.1 pyhd8ed1ab_0 conda-forge rich-click 1.7.4 pyhd8ed1ab_0 conda-forge rsa 4.9 pyhd8ed1ab_0 conda-forge scikit-learn 1.4.1.post1 py310h1fdf081_0 conda-forge scipy 1.12.0 py310hb13e2d6_2 conda-forge setuptools 69.2.0 pyhd8ed1ab_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge snappy 1.1.10 h9fff704_0 conda-forge taxopy 0.12.0 pyhdfd78af_0 bioconda tensorboard 2.15.2 pyhd8ed1ab_0 conda-forge tensorboard-data-server 0.7.0 py310h75e40e8_1 conda-forge tensorflow 2.15.0 cpu_py310h7825f03_2 conda-forge tensorflow-base 2.15.0 cpu_py310h7e4d085_2 conda-forge tensorflow-estimator 2.15.0 cpu_py310haacee6a_2 conda-forge termcolor 2.4.0 pyhd8ed1ab_0 conda-forge threadpoolctl 3.3.0 pyhc1e730c_0 conda-forge tk 8.6.13 noxft_h4845f30_101 conda-forge typing-extensions 4.10.0 hd8ed1ab_0 conda-forge typing_extensions 4.10.0 pyha770c72_0 conda-forge tzdata 2024a h0c530f3_0 conda-forge urllib3 2.2.1 pyhd8ed1ab_0 conda-forge werkzeug 3.0.1 pyhd8ed1ab_0 conda-forge wget 1.21.4 hda4d442_0 conda-forge wheel 0.42.0 pyhd8ed1ab_0 conda-forge wrapt 1.14.1 py310h5764c6d_1 conda-forge xgboost 2.0.3 cpu_pyhb06c54e_1 conda-forge xz 5.2.6 h166bdaf_0 conda-forge yarl 1.9.4 py310h2372a71_0 conda-forge zipp 3.17.0 pyhd8ed1ab_0 conda-forge zlib 1.2.13 hd590300_5 conda-forge zstd 1.5.5 hfc55251_0 conda-forge

apcamargo commented 3 months ago

Hi @WUD2018,

Thank you for your report. It seems like this is the same bug reported by @erinyoung here. The problem is that Keras 3 created some incompatibilities which leads to a few problems in geNomad. In the future I'll investigate updating the code to support Keras 3, but for the time being I restricted to keras <3.0.

I just pushed version 1.7.6 which should fix this. You can fix in your own environment by downgrading Keras.

WUD2018 commented 3 months ago

Hi @WUD2018,

Thank you for your report. It seems like this is the same bug reported by @erinyoung here. The problem is that Keras 3 created some incompatibilities which leads to a few problems in geNomad. In the future I'll investigate updating the code to support Keras 3, but for the time being I restricted to keras <3.0.

I just pushed version 1.7.6 which should fix this. You can fix in your own environment by downgrading Keras.

Thanks for your new push, the genomad works now! Here is my installation process:

526 mamba create -n genomad 527 conda activate genomad 528 mamba install mmseqs2 529 mamba install aragorn 530 pipx install genomad==1.7.6

But, please note that (don't know why, but for reference to other users) : I also installed pipx in the created environment by: mamba install pipx the following 'pipx install genomad==1.7.6' was not successful. So please just use the pipx you previously installed and you will find a pipx fold created in the ./local instead of ./local/share

Thanks!

apcamargo commented 3 months ago

Thanks, @WUD2018!