首页 > 解决方案 > Google colaboratory:无法从 utils 导入“LRN2D”

问题描述

我正在 Google Colaboratory 上试用 Python Notebook https://github.com/TessFerrandez/research-papers/tree/master/facenet 。

我什至无法在代码上运行第一个块,因为我收到了这个错误:

() 中的ImportError
Traceback(最近一次调用最后一次)

  1 from model import create_model

/content/model.py in ()

 12 import utils
 13 from utils import LRN2D
 14 
 15 def create_model():

ImportError:无法导入名称“LRN2D”

我已经 !pip 安装了 utils。请帮我

标签: pythontensorflowgoogle-colaboratory

解决方案


不要!pip install utils只使用它。

!git clone https://github.com/TessFerrandez/research-papers.git
%cd research-papers/facenet
from model import create_model

这里的utils意思是 local utils.py,而不是其他项目的一些 utils 库


推荐阅读