###やりたいこと
python3.7環境でkerasを利用したい。
import keras.layers import Merge, Dense, Reshape, Embedding
とIPythonカーネルのセルに入力して実行したところ以下のようなエラーが吐かれた。
Using TensorFlow backend. ERROR:root:Internal Python error in the inspect module. Below is the traceback from this internal error. ERROR:root:Internal Python error in the inspect module. Below is the traceback from this internal error. <<<中略>>> ImportError: cannot import name 'executing_eagerly' from 'tensorflow.python.eager.context' (/Users/username/Library/Python/3.7/lib/python/site-packages/tensorflow_core/python/eager/context.py)
※ディレクトリのusername部分は私のpcの名前
また、このまま再度カーネルをリセットせずセルを実行すると以下のような先と異なるエラーが吐かれた。
AttributeError: module 'tensorflow' has no attribute 'name_scope'
このエラーを吐かないようにして、import kerasを成立させたい。
###試したこと
1, 関連するパッケージを全削除(pip3 uninstall 〇〇)の上、以下を実行。
$pip3 install tensorflow $pip3 install keras
2,強制再インストール
$pip3 install --force-reinstall tensorflow
###各パッケージのバージョン
Package Version -------------------- ---------- absl-py 0.9.0 appnope 0.1.0 astor 0.8.1 attrs 19.3.0 backcall 0.1.0 bleach 3.1.0 cachetools 4.0.0 certifi 2019.11.28 chardet 3.0.4 decorator 4.4.1 defusedxml 0.6.0 entrypoints 0.3 gast 0.2.2 google-auth 1.11.0 google-auth-oauthlib 0.4.1 google-pasta 0.1.8 grpcio 1.26.0 h5py 2.10.0 idna 2.8 importlib-metadata 1.5.0 ipykernel 5.1.4 ipython 7.12.0 ipython-genutils 0.2.0 ipywidgets 7.5.1 jedi 0.16.0 Jinja2 2.11.1 jsonschema 3.2.0 jupyter 1.0.0 jupyter-client 5.3.4 jupyter-console 6.1.0 jupyter-core 4.6.1 Keras 2.3.1 Keras-Applications 1.0.8 Keras-Preprocessing 1.1.0 Markdown 3.1.1 MarkupSafe 1.1.1 mistune 0.8.4 nbconvert 5.6.1 nbformat 5.0.4 notebook 6.0.3 numpy 1.18.1 oauthlib 3.1.0 opt-einsum 3.1.0 pandocfilters 1.4.2 parso 0.6.0 pexpect 4.8.0 pickleshare 0.7.5 pip 20.0.2 prometheus-client 0.7.1 prompt-toolkit 3.0.3 protobuf 3.11.2 ptyprocess 0.6.0 pyasn1 0.4.8 pyasn1-modules 0.2.8 Pygments 2.5.2 pyrsistent 0.15.7 python-dateutil 2.8.1 PyYAML 5.3 pyzmq 18.1.1 qtconsole 4.6.0 requests 2.22.0 requests-oauthlib 1.3.0 rsa 4.0 scipy 1.4.1 Send2Trash 1.5.0 setuptools 45.1.0 six 1.14.0 tensorboard 2.1.0 tensorflow 2.1.0 tensorflow-estimator 2.1.0 termcolor 1.1.0 terminado 0.8.3 testpath 0.4.4 tornado 6.0.3 traitlets 4.3.3 urllib3 1.25.8 wcwidth 0.1.8 webencodings 0.5.1 Werkzeug 0.16.1 wheel 0.34.2 widgetsnbextension 3.5.1 wrapt 1.11.2 zipp 2.1.0
![guest](/img/icon/icnUserSample.jpg)
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。