python - 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"
您知道如何解决此导入错误吗?
解决方案
推荐阅读
- elasticsearch - 将Kafka主题标题显示为Kibana中的字段,logstash add_field?
- django - 多对多关系的 Django 动态表单
- c# - 对所有可能的指标值、排列进行策略优化
- jquery - 在 Django 应用程序中单击时刷新显示的数据
- azure - 如何在 Azure 中检查向 IoT 中心发送消息的来源?
- c++ - 为什么虚拟 cudaMalloc 在moderngpu 中加速interval_gather?
- sql - JPA 查询参数 IN 或 IS NULL
- firebase - Firebase 实时数据库过滤数据
- python - PYTHON CSV 文件上传 - WebUI -> Lambda ->S3
- python - 在“字符串”类型的 pd.dataframe 上使用 iloc 时,字符串比较总是错误的