首页 > 解决方案 > ImportError:没有名为 src.utils tensorflow 的模块

问题描述

我正在尝试在 jupyter notebook 中加载 tensorflow 并收到以下错误:


ImportError                               Traceback (most recent call last) <ipython-input-1-28a19874e1dd> in <module>()
      5 import tensorflow as tf
      6 from tensorflow.python.framework import ops
----> 7 from tf_utils import load_dataset, random_mini_batches, convert_to_one_hot, predict
      8 
      9 get_ipython().magic(u'matplotlib inline')

/Pathway/tf_utils.py in <module>()
     17 import sys
     18 import tensorflow as tf
---> 19 import src.utils as utils
     20 import logging
     21 from tensorflow.contrib import slim

ImportError: No module named src.utils

我安装了最新的 tensorflow,并且还通过以下方式将模型添加到 PYTHONPATH:

export PYTHONPATH="$PYTHONPATH:/Pathway/tfmodels-1.9.0"

您知道如何解决此导入错误吗?

标签: pythontensorflowjupyter-notebook

解决方案



推荐阅读