【发布时间】:2023-02-20 09:36:33
【问题描述】:
我使用 official instructions 安装了 tensorflow:
conda create -n tf-gpu tensorflow-gpu
如果我激活内核,我可以看到安装了 tensorflow。
conda activate tf-gpu
python3 -c 'import tensorflow as tf; print(tf.__version__)'
它返回以下内容。
2022-03-24 01:21:50.006341: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.10.1
2.4.1
现在我想让 tf-gpu 被识别为 jupyter notebook 中的内核。
conda deactivate tf-gpu
python -m ipykernel install --user --name=tf-gpu
但是,当我启动 jupyter 笔记本时
jupyter notebook
创建的 tf-gpu notebook 没有按预期工作。
import tensorflow
返回以下错误
ModuleNotFoundError: No module named 'tensorflow'
为什么包裹没有被识别?
【问题讨论】:
标签: python tensorflow import jupyter-notebook anaconda