gpt4 book ai didi

python - 在 Colaboratory 上安装 cleverhans

转载 作者:太空宇宙 更新时间:2023-11-04 09:51:42 28 4
gpt4 key购买 nike

我正在尝试安装 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 路径。这是对我有用的片段:

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

关于python - 在 Colaboratory 上安装 cleverhans,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47525550/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com