【问题标题】:Google colaboratory: Cannot import 'LRN2D' from utilsGoogle colaboratory:无法从 utils 导入“LRN2D”
【发布时间】:2019-08-06 01:15:59
【问题描述】:

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

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

导入错误
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。请帮帮我

【问题讨论】:

    标签: python tensorflow google-colaboratory


    【解决方案1】:

    不要!pip install utils,而是使用它。

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

    这里,utils 是指本地的utils.py,而不是一些其他项目的一些 utils 库

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-13
      • 2018-04-09
      • 2022-12-21
      • 2012-08-20
      • 2021-07-10
      • 2019-08-28
      相关资源
      最近更新 更多