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

The tensorflow showing error with no session attribute #23

Closed honghh2018 closed 1 year ago

honghh2018 commented 2 years ago

Hi Developer, The cell-blast had been installed in conda environment with python3.9 and then install the tensorflow with pip by default version: tensorflow 2.9.1 tensorflow-estimator 2.9.0

when i run the cell-blast workflow, the tensorflow trigger below error: from . import module, nn, utils File "/share/apps/virtualEnv/miniconda3-py38/envs/CellBlast-CellAnno/lib/python3.9/site-packages/Cell_BLAST/module.py", line 15, in class Module(object): File "/share/apps/virtualEnv/miniconda3-py38/envs/CellBlast-CellAnno/lib/python3.9/site-packages/Cell_BLAST/module.py", line 32, in Module def _save_weights(self, sess: tf.Session, path: str) -> None: AttributeError: module 'tensorflow' has no attribute 'Session'

how can i fix this issue? Any advice would be appreciated hanhuihong

honghh2018 commented 2 years ago

Had anyone hear this?

honghh2018 commented 2 years ago

I change the tf.Session with tf.compat.v1.Session, it can fix this issue,however the another issue show up following below:

key = _get_single_key(k, silent) File "/share/apps/virtualEnv/miniconda3-py38/envs/CellBlast-CellAnno/lib/python3.9/site-packages/pandas/_config/config.py", line 116, in _get_single_key raise OptionError("Pattern matched multiple keys") pandas._config.config.OptionError: 'Pattern matched multiple keys'

Best, hanhuihong

Jeff1995 commented 2 years ago

Thanks for your interest in Cell BLAST!

The current version (v0.3.8) depends on the old TensorFlow v1. We will be changing the backend to PyTorch in the coming release (v0.5.0), and the old TensorFlow implementation will no longer be maintained.

For the second question, could you post the full traceback so that it's easier to locate the problem?

Van1yu3 commented 1 year ago

The current version (v0.3.8) depends on the old TensorFlow v1. We will be changing the backend to PyTorch in the coming release (v0.5.0), and the old TensorFlow implementation will no longer be maintained.

@Jeff1995 Hello Jeff, seems that v.0.5.0 is still a pre-release, and pip install Cell-BLAST gets me to install v0.3.8. May I ask if you are going to release the latest version soon?

The cell-blast had been installed in conda environment with python3.9 and then install the tensorflow with pip by default version: tensorflow 2.9.1 tensorflow-estimator 2.9.0

Hi @honghh2018, here comes my late solution to your problem. Since the current release version is still v0.3.8, I suggest referring to the previous commit to install python 3.6 and tensorflow 1.12, and going to the example folder for the tutorials.

Jeff1995 commented 1 year ago

Hi @Van1yu3! We are still ironing out issues with the online portal (cblast.gao-lab.org) after this update. v0.5.0 will be released as soon as we are able to update the online portal. I'll let you know when that happens.

Jeff1995 commented 1 year ago

v0.5.0 is now formally released. You may update via PyPI.