在合作实验室上安装cleverhans [英] Installing cleverhans on Colaboratory

查看:58
本文介绍了在合作实验室上安装cleverhans的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to install cleverhans (https://github.com/tensorflow/cleverhans)

我正在运行以下命令

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

但是,当我尝试执行 import cleverhans 时,我收到一条错误消息,提示没有此类模块.

However, when I try to do import cleverhans I get an error saying that there's no such module.

PS如果我尝试在本地计算机上安装模块,则源代码存储在〜/.src/cleverhans 中.

PS If I try to install the module on my local machine, the source is stored in ~/.src/cleverhans.

推荐答案

安装似乎无法正确更新python路径.这是一个对我有用的代码片段:

It looks like the installation doesn't properly update the python path. Here's a snippet that worked for me:

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

这篇关于在合作实验室上安装cleverhans的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆