gao-lab / Cell_BLAST

A BLAST-like toolkit for large-scale scRNA-seq data querying and annotation.
http://cblast.gao-lab.org
MIT License
82 stars 13 forks source link

optimizer = tf.train.__dict__[optimizer] in _compile KeyError: 'RMSPropOptimizer' #1

Closed JunWangmath closed 4 years ago

JunWangmath commented 5 years ago

Hi, I installed everything following your recommended. Got the error when running the following command.

model = cb.directi.fit_DIRECTi( baron_human, baron_human.uns["seurat_genes"], latent_dim=10, cat_dim=20, epoch=50, path="./baron_human_model" )

error message: File "/Users/anaconda3/envs/cb/lib/python3.6/site-packages/Cell_BLAST/directi.py", line 234, in _compile self.step = tf.train.dictoptimizer.minimize(

KeyError: 'RMSPropOptimizer'

Maybe there is a problem in tf.train.dict[optimizer]. Temporally, I just use optimizer = tf.train.RMSPropOptimizer(lr) to bypass this issue.

Thanks.

Jeff1995 commented 5 years ago

Thanks for the report. I guess this is most likely related to an incompatible version tensorflow. To better track down the problem, can you provide which version of tensorflow are you using?

JunWangmath commented 5 years ago

Thanks for the quick reply. At first, I installed tensorflow cpu version 1.14. Then I realized there might be an incompatible version tensorflow, so I installed 1.8.0 instead. conda list gives me the following: tensorboard 1.8.0 py36_1 conda-forge tensorflow 1.8.0 py36_1 conda-forge tensorflow-base 1.14.0 mkl_py36h655c25b_0
tensorflow-estimator 1.14.0 py_0

Jeff1995 commented 5 years ago

Thanks for the clarification. I can reproduce the error with tensorflow v1.14.0, so that's indeed a version compatibility problem. I will change these lines to getattr(tf.train, optimizer) in our next release, which seems to work in newer versions of tensorflow.

Before that release is ready, I would suggest that you reinstall all packages related to tensorflow as v1.8.0, as your conda list seems to report mixed versions of v1.8.0 and v1.14.0. In case that doesn't solve the problem, I would recommend using the same conda channel (the default one) for all tensorflow packages, as I personally have had problems with mixed channels before.

Jeff1995 commented 4 years ago

Fixed in v0.2.14