<ol>
<li>The 'blunderbus' way to do this is as follows (not recommended in this instance :-) ),</li>
</ol>
<pre><code>    conda update --all
    conda update -n base conda
    conda update -n myenv --all
</code></pre>
<ol start="2">
<li>The refined way to do this is</li>
</ol>
<pre><code>    conda update -n myenv tensorflow # see `Best guess, notes
</code></pre>
<p>In theory <code>conda</code> was supposed to sort out the deprecation, because all the versions were supposed to be harmonious. I'm a bit puzzled (see below). What might have happened is <code>tensorflow</code> has been upgraded (or <code>keras</code>) against the version the developer had written it for.</p>
<p>Here <code>myenv</code> is the name you gave that given conda environment.</p>
<p>In your case, I would look at point 2, because the environment is very specific to your project and ensures reproducibility.</p>
<p><em>Note</em> A purist would specify the exact channel <code>-c</code> that <code>tensorflow</code> is found in, or whatever dependency. This actually can be very important because there can be name conflicts, obviously not for <code>tensorflow</code> because I'm pretty sure Google have the name registered.</p>
<p>The reason I do point 1 is the problem might a dependency of <code>tensorflow</code> and you'd have to figure it out, but again see 'notes'.</p>
<hr />
<p><strong>Best guess</strong></p>
<p>In this particular example,</p>
<pre><code>conda update -n myenv keras
</code></pre>
<p>Might be the ticket, because what I think is going on is its not actually <code>tensorflow</code> but the <code>keras</code> sitting above it.</p>
<p>The alternative (probably better) guess is ....</p>
<pre><code>conda update -n myenv -c bioconda deepbgc
</code></pre>
<p>This is probably what I would try first.</p>
<p><strong>Note</strong> I'm surprised that <code>conda</code>/<code>mamba</code> has not resolved this issue on installation because thats exactly what is it is supposed to do. In other words its supposed to make a perfect installation of <code>deepbgc</code> precisely as the developer had intended it. There is a risk that updating might not be the solution ... and solution is a new <code>conda</code>/<code>mamba</code> installation (see note 2).</p>
<p><strong>Note 2</strong> Watch for the <code>Python</code> version, you are using 3.7 ... that might be an issue. If the developer had written this for &gt;<code>3.7</code> that could cause problems. Different Python versions have different methods and if one of the 'new' methods was being used that would be an issue. Ultimately your  package/pipeline is really complex and the more stuff the more chance stuff doesn't fit together. We're currently on <code>3.10</code> and <code>3.9</code> is really stable.</p>
<p><strong>BTW</strong> <code>3.11</code> will be a major upgrade of <code>Python3</code> and will be the 'goto' version.</p>
<hr />
<p>I looked at <code>deepbgc</code> its built on <code>Python3.7</code>, I don't know why because it was released in 2019. My advice is start again with a new install and follow the instructions exactly as on Github. The order of the build is really important (omitting pip use <code>conda</code>/<code>mamba</code> instead). It doesn't seem to be very <code>conda</code> but thats how the developer did it. In theory the whole pipeline could have been placed on <code>conda</code>. Instructions here <a href="https://github.com/Merck/deepbgc" rel="nofollow noreferrer">https://github.com/Merck/deepbgc</a></p>
<p>The key issue is that it is built on an old build of Python, with a lot of dependencies which have substancially changed. There is concern about ...</p>
<pre><code>conda create -n deepbgc python=3.7 hmmer prodigal
</code></pre>
<p>because the author is not specifying the versions of hmmer or prodigal. These should have been built into the <code>conda</code> upload.</p>

CC BY-SA 4.0
2022-10-04T23:59:32.450Z
Thanks! I will go ahead and give this a try. Now just want to confirm this, the conda update -n myenv ... command is run outside the environment, correct? In other words, when the environment is deactivated?
Joe_G
CC BY-SA 4.0
2022-10-05T00:10:51.077Z
Yes outside the given `env`. In this case I don't think it will make any difference but its you never know.
M__
CC BY-SA 4.0
2022-10-05T14:47:20.040Z
So when I try running conda update -n my env keras, I am getting the following error: PackageNotInstalledError: Package is not installed in prefix.
  prefix: /EFS/tools/miniconda/envs/deepbgc2
  package name: keras - should i be providing the full path to the package when i update? I tried to cd into the directory where the package is located and I got the same error message
Joe_G
CC BY-SA 4.0
2022-10-05T21:15:05.197Z
I've updated the post
M__
CC BY-SA 4.0
2022-10-04T22:18:13.840Z
2022-10-05T21:14:43.193Z
2022-10-05T21:14:43.193Z
M__
<p>I have come across some related issues pertaining to this tensorflow warning but none related specifically to deepbgc</p>
<p>I have created a conda environment and have installed onto it the bioinformatics analysis tool deepbgc. Now the program runs but it does output some warning messages related to the tensorflow package. When I run the &quot;deepbgc info&quot; command through terminal, I get the following output messages related to the tensor flow package:</p>
<pre><code>Using TensorFlow backend.
WARNING 03/10 12:55:05   From /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:74: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.

WARNING 03/10 12:55:05   From /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:517: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

WARNING 03/10 12:55:05   From /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:4138: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

WARNING 03/10 12:55:06   From /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:133: The name tf.placeholder_with_default is deprecated. Please use tf.compat.v1.placeholder_with_default instead.

WARNING 03/10 12:55:06   From /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:3445: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.
Instructions for updating:
Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.
WARNING 03/10 12:55:06   From /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:174: The name tf.get_default_session is deprecated. Please use tf.compat.v1.get_default_session instead.

WARNING 03/10 12:55:06   From /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:181: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.

WARNING 03/10 12:55:06   From /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:186: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

WARNING 03/10 12:55:06   From /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:190: The name tf.global_variables is deprecated. Please use tf.compat.v1.global_variables instead.

WARNING 03/10 12:55:06   From /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:199: The name tf.is_variable_initialized is deprecated. Please use tf.compat.v1.is_variable_initialized instead.

WARNING 03/10 12:55:06   From /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:206: The name tf.variables_initializer is deprecated. Please use tf.compat.v1.variables_initializer instead.
</code></pre>
<p>Could this be related to the version of tensorflow? Currently, I have version 1.15.4 installed onto the conda environment. Are these error messages significant and could they impact the data running through deepbgc? Or can they mostly be ignored? Any guidance appreciated, thanks!</p>

CC BY-SA 4.0
2022-10-03T19:06:45.163Z
That should be easy to sort out and its good to get it sorted. I'll reply tomorrow.
M__
CC BY-SA 4.0
2022-10-04T18:33:50.683Z
@M_ great, I appreciate it. I was thinking maybe this was an issue with my tensor flow version so I tried updating it but the problem with that is it makes other packages like numpy incompatible with the version of deepbgc I'm running on. Could an update to deepbgc do the trick and then subsequently, an update to tensorflow?
Joe_G
<python><deeptools><conda><tensorflow>
Warning message related to tensorflow package when trying to run deepbgc bioinformatics tool
# Warning message related to tensorflow package when trying to run deepbgc bioinformatics tool

(Asked by: username_0 on 2022-10-03)

I have come across some related issues pertaining to this tensorflow warning but none related specifically to deepbgc
I have created a conda environment and have installed onto it the bioinformatics analysis tool deepbgc. Now the program runs but it does output some warning messages related to the tensorflow package. When I run the "deepbgc info" command through terminal, I get the following output messages related to the tensor flow package:
Using TensorFlow backend.
WARNING 03/10 12:55:05   From /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:74: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.

WARNING 03/10 12:55:05   From /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:517: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

WARNING 03/10 12:55:05   From /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:4138: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

WARNING 03/10 12:55:06   From /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:133: The name tf.placeholder_with_default is deprecated. Please use tf.compat.v1.placeholder_with_default instead.

WARNING 03/10 12:55:06   From /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:3445: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.
Instructions for updating:
Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.
WARNING 03/10 12:55:06   From /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:174: The name tf.get_default_session is deprecated. Please use tf.compat.v1.get_default_session instead.

WARNING 03/10 12:55:06   From /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:181: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.

WARNING 03/10 12:55:06   From /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:186: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

WARNING 03/10 12:55:06   From /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:190: The name tf.global_variables is deprecated. Please use tf.compat.v1.global_variables instead.

WARNING 03/10 12:55:06   From /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:199: The name tf.is_variable_initialized is deprecated. Please use tf.compat.v1.is_variable_initialized instead.

WARNING 03/10 12:55:06   From /EFS/tools/miniconda/envs/deepbgc2/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:206: The name tf.variables_initializer is deprecated. Please use tf.compat.v1.variables_initializer instead.

Could this be related to the version of tensorflow? Currently, I have version 1.15.4 installed onto the conda environment. Are these error messages significant and could they impact the data running through deepbgc? Or can they mostly be ignored? Any guidance appreciated, thanks!

**Tags:** python, deeptools, conda, tensorflow
> **Comments:**
> **username_1**: That should be easy to sort out and its good to get it sorted. I'll reply tomorrow.  
> **username_0**: @M_ great, I appreciate it. I was thinking maybe this was an issue with my tensor flow version so I tried updating it but the problem with that is it makes other packages like numpy incompatible with the version of deepbgc I'm running on. Could an update to deepbgc do the trick and then subsequently, an update to tensorflow?  

---

## 1 answers

### Answer by username_1 on 2022-10-04. Score: 1

The 'blunderbus' way to do this is as follows (not recommended in this instance :-) ),

    conda update --all
    conda update -n base conda
    conda update -n myenv --all


The refined way to do this is

    conda update -n myenv tensorflow # see `Best guess, notes

In theory conda was supposed to sort out the deprecation, because all the versions were supposed to be harmonious. I'm a bit puzzled (see below). What might have happened is tensorflow has been upgraded (or keras) against the version the developer had written it for.
Here myenv is the name you gave that given conda environment.
In your case, I would look at point 2, because the environment is very specific to your project and ensures reproducibility.
Note A purist would specify the exact channel -c that tensorflow is found in, or whatever dependency. This actually can be very important because there can be name conflicts, obviously not for tensorflow because I'm pretty sure Google have the name registered.
The reason I do point 1 is the problem might a dependency of tensorflow and you'd have to figure it out, but again see 'notes'.

Best guess
In this particular example,
conda update -n myenv keras

Might be the ticket, because what I think is going on is its not actually tensorflow but the keras sitting above it.
The alternative (probably better) guess is ....
conda update -n myenv -c bioconda deepbgc

This is probably what I would try first.
Note I'm surprised that conda/mamba has not resolved this issue on installation because thats exactly what is it is supposed to do. In other words its supposed to make a perfect installation of deepbgc precisely as the developer had intended it. There is a risk that updating might not be the solution ... and solution is a new conda/mamba installation (see note 2).
Note 2 Watch for the Python version, you are using 3.7 ... that might be an issue. If the developer had written this for >3.7 that could cause problems. Different Python versions have different methods and if one of the 'new' methods was being used that would be an issue. Ultimately your  package/pipeline is really complex and the more stuff the more chance stuff doesn't fit together. We're currently on 3.10 and 3.9 is really stable.
BTW 3.11 will be a major upgrade of Python3 and will be the 'goto' version.

I looked at deepbgc its built on Python3.7, I don't know why because it was released in 2019. My advice is start again with a new install and follow the instructions exactly as on Github. The order of the build is really important (omitting pip use conda/mamba instead). It doesn't seem to be very conda but thats how the developer did it. In theory the whole pipeline could have been placed on conda. Instructions here https://github.com/Merck/deepbgc
The key issue is that it is built on an old build of Python, with a lot of dependencies which have substancially changed. There is concern about ...
conda create -n deepbgc python=3.7 hmmer prodigal

because the author is not specifying the versions of hmmer or prodigal. These should have been built into the conda upload.

> **Comments:**
> **username_0**: Thanks! I will go ahead and give this a try. Now just want to confirm this, the conda update -n myenv ... command is run outside the environment, correct? In other words, when the environment is deactivated?  
> **username_1**: Yes outside the given `env`. In this case I don't think it will make any difference but its you never know.  
> **username_0**: So when I try running conda update -n my env keras, I am getting the following error: PackageNotInstalledError: Package is not installed in prefix.   prefix: /EFS/tools/miniconda/envs/deepbgc2   package name: keras - should i be providing the full path to the package when i update? I tried to cd into the directory where the package is located and I got the same error message  
> **username_1**: I've updated the post  

---

