biocore / songbird

Vanilla regression methods for microbiome differential abundance analysis
BSD 3-Clause "New" or "Revised" License
54 stars 25 forks source link

ModuleNotFoundError: No module named 'tensorflow.contrib' #120

Closed ghost closed 2 years ago

ghost commented 4 years ago

Hi, mortonjt I run this command on terminal "conda create -n songbird_env songbird "pandas>=0.18.0,<1" -c conda-forge source activate songbird_env ". I got this error Traceback (most recent call last): File "/Users/phimnoi/opt/anaconda3/envs/songbird_env/bin/songbird", line 8, in from songbird.multinomial import MultRegression File "/Users/phimnoi/opt/anaconda3/envs/songbird_env/lib/python3.7/site-packages/songbird/multinomial.py", line 3, in from tensorflow.contrib.distributions import Multinomial, Normal ModuleNotFoundError: No module named 'tensorflow.contrib'. by using TensorFlow-2.1.0

I try to switch TensorFlow-2.1.0 to 1.14. I got this error tfv.1.14error.txt

Thank you

mortonjt commented 4 years ago

Looks like it has been installed correctly now - but your error suggests that your biom table is empty see "tensorflow.python.framework.errors_impl.InvalidArgumentError: num_classes should be positive, got 0".

It maybe worth double checking to make sure that your input types are sane.

ghost commented 4 years ago

I checked .biom file and found that If I use .biom like this

Constructed from biom file

OTU ID SC9987 SC9988 SC9989 SC9990 SC9991

ffc36e27c82042664a16bcd4d380b286 52.0 32.0 57.0 1229.0 13.0 6b6d13f1332283e053c18c3b7774b85c 115.0 130.0 0.0 0.0 0.0 c6fdf631c16099e62a83c66db8a7a6f1 312.0 393.0 397.0 0.0 0.0 8f6e2a91e20994c00566a5ff2b49506e 491.0 163.0 209.0 408.0 284.0 15e05255b2aa8ee3524ca61eb207bb18 252.0 490.0 238.0 0.0 101.0

I got an error " tensorflow.python.framework.errors_impl.InvalidArgumentError: num_classes should be positive, got 0" as you said.

But if trying to change to .biom like this

Constructed from biom file

OTU ID SC9987 SC9988 SC9989 SC9990 SC9991

dArchaea;pEuryarchaeota;cMethanobacteria;oMethanobacteriales;fMethanobacteriaceae;gMethanobrevibacter 0.0 0.0 0.0 0.0 0.0 dBacteria;;;;; 0.0 0.0 0.0010662496445834517 0.0 0.0013676872849201448 dBacteria;pActinobacteriota;cActinobacteria;oActinomycetales;fActinomycetaceae;gActinomyces 0.0 0.0 0.0 0.0 0.0 dBacteria;pActinobacteriota;cActinobacteria;oBifidobacteriales;fBifidobacteriaceae;gBifidobacterium 0.012714395426230906 0.013210345786594975 0.012297412567529144 0.015138023152270703 0.0

I got an error "ValueError: initial_value must have a shape specified: Tensor("random_normal:0", shape=(3, ?), dtype=float32)"

Thank you for your responding

mortonjt commented 4 years ago

@Phimsri , just to confirm, are you using the biom hdf5 format as suggested in the biom docs? http://biom-format.org/

Also, do you have the same error when running the examples shown in the README? If you can run the examples in the tutorials, that can help isolate whether it is a problem with your installation, or a problem with your input files.

mortonjt commented 2 years ago

Hi @ghost, I'm going to close this issue for now. If you are still having problems, feel free to reopen.