【问题标题】:Installing cleverhans on Colaboratory在 Colaboratory 上安装cleverhans
【发布时间】:2021-03-11 06:38:36
【问题描述】:

我正在尝试安装cleverhans (https://github.com/tensorflow/cleverhans)

我正在运行以下命令

!pip install -q -e git+http://github.com/tensorflow/cleverhans.git#egg=cleverhans

但是,当我尝试执行 import cleverhans 时,我收到一条错误消息,指出没有这样的模块。

PS 如果我尝试在本地机器上安装模块,源存储在~/.src/cleverhans

【问题讨论】:

    标签: python google-colaboratory cleverhans


    【解决方案1】:

    看起来安装没有正确更新 python 路径。这是一个对我有用的 sn-p:

    !pip install -qq -e git+http://github.com/tensorflow/cleverhans.git#egg=cleverhans
    import sys
    sys.path.append('/content/src/cleverhans')
    import cleverhans
    

    【讨论】:

    • 像魅力一样工作!每次重新打开笔记本时都需要安装它吗?
    • 您需要为每个 VM 重新执行一次该单元。虚拟机在一段时间不活动后被回收;见stackoverflow.com/questions/47474406
    猜你喜欢
    • 2018-06-06
    • 1970-01-01
    • 2020-06-16
    • 2018-06-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-08
    相关资源
    最近更新 更多