問題
Ubuntu16.04でtensorflow-gpuをインストールした。
anacondaの仮想環境上ではimportできたのに,VScode(Jupyter)からはimportできない!!!!
原因
Anaconda上でのPythonパスとJupyter上でのPythonパスが一致していないらしい。
超参考にしたサイト➡https://qiita.com/tk_01/items/9d3961e386714b67f732
直し方
tensorflowをインストールした仮想環境をアクティベートして,
仮想環境をアクティベート
$ source activate <環境名>
以下のコマンドを実行。
Jupyterのkernelを作成
~(環境名)$ conda install notebook ipykernel
~(環境名)$ ipython kernel install --user --name <環境名> --display-name <jupyter上の表記を設定>
これでもう一度importしたらうまくいった!