question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

compatibility problem with tensorflow 2

See original GitHub issue

Hello! thank you for this amazing package you created. We are currently encountering some problems of compatibility with tensorflow 2. Once we install the package, we cannot even import the library because:

`

AttributeError Traceback (most recent call last) <ipython-input-1-ece3104b9f41> in <module> ----> 1 from deepexplain.tensorflow import DeepExplain

/home/eprifti/src/deepexplain/deepexplain/tensorflow/init.py in <module> ----> 1 from .methods import DeepExplain

/home/eprifti/src/deepexplain/deepexplain/tensorflow/methods.py in <module> 552 553 –> 554 class DeepExplain(object): 555 556 def init(self, graph=None, session=tf.get_default_session()):

/home/eprifti/src/deepexplain/deepexplain/tensorflow/methods.py in DeepExplain() 554 class DeepExplain(object): 555 –> 556 def init(self, graph=None, session=tf.get_default_session()): 557 self.method = None 558 self.batch_size = None

AttributeError: module ‘tensorflow’ has no attribute ‘get_default_session’`

we tried to fix it without any success. Do you have any suggestion?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Zhangyang823commented, Dec 22, 2021

你好,来信已收到~~

1reaction
marcoanconacommented, Dec 7, 2019

Sorry I had no time to look into this yet. TF2 brings major changes and since DeepExplain uses some low level features the porting might not be straight-forward. Does it work if you disable tf2 features?

Definitely, DeepExplain does not support Eager Execution which can be disabled with

import tensorflow as tf
tf.compat.v1.disable_eager_execution()

You can also try disabling v2 features entirely:

import tensorflow as tf
tf.compat.v1.disable_v2_behavior()
Read more comments on GitHub >

github_iconTop Results From Across the Web

tensorflow2.0.0 compatibility with scipy · Issue #50517 - GitHub
Can you please try to install 1.4.x version for tf v2.0.Also please take a look at the issue link for more information.Link1.Thanks!
Read more >
TensorFlow version compatibility
Version skew in distributed Tensorflow: Running two different versions of TensorFlow in a single cluster is unsupported. There are no guarantees ...
Read more >
How to resolve compatibility issues for Tensorflow and ...
The problem was caused by jupyter/tensorflow being loaded in the background. The following solved the issue:
Read more >
Solution to TensorFlow 2 not using GPU | by Shakti Wadekar
This article addresses the reason and debugging/solution process to solve the issue of tensorflow 2 (tf2) not using GPU.
Read more >
How to install Tensorflow on the Apple M1 Notebook
python -m pip install tensorflow-macos will run Python 2 and ask it to install tensorflow which is why you're getting the error that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found