Open SebFAU opened 4 years ago
I had the same problem and found that restarting the runtime after installing DeepExplain usually helps.
So after connecting to a runtime the first cell I run just installs DeepExplain:
import sys
!{sys.executable} -m pip install -e git+https://github.com/marcoancona/DeepExplain.git#egg=deepexplain
Then restart the runtime via Runtime
-> restart runtime
. After the runtime comes back just continue with importing DeepExplain
. If you run into the error module 'tensorflow' has no attribute 'get_default_session'
make sure to force loading Tensorflow 1.x, since Google Colab now uses Tensorflow 2.x by default. So my second cell in the notebook (and the first I run after restarting the runtime) is
%tensorflow_version 1.x
from deepexplain.tensorflow import DeepExplain
I have the same error in jupyter notebook. Might be an issue with tensorflow 2
Expected behaviour
When using the command:
!pip install -e git+https://github.com/marcoancona/DeepExplain.git#egg=deepexplain
in the interactive session of Google colab, the installation succeeds and you should be able to import the library via:
from deepexplain.tensorflow import DeepExplain
Actual behaviour
The import fails with a "Module not found" error. That's why I tried the following workaround after solving the environment on Google's Linux-Server:
import sys; sys.path.append("/content/src/deepexplain"); from deepexplain.tensorflow import DeepExplain
which results in a Key Error.
Backtrace
`KeyError Traceback (most recent call last)