用于代码缺陷检测的数据集生成
用于代码缺陷检测的数据集生成论文地址:Towards security defect prediction with AI代码仓库地址:sa-bAbI运行环境:阿里云 Ubuntu 16.04权限:root阿里云下的Ubuntu什么东西都要现安装。apt-get updateapt-get install git切换到根目录cd /下载代码仓库git clone https:...
用于代码缺陷检测的数据集生成
论文地址:Towards security defect prediction with AI
代码仓库地址:sa-bAbI
运行环境:阿里云 Ubuntu 16.04
权限:root
阿里云下的Ubuntu什么东西都要现安装。
apt-get update
apt-get install git
切换到根目录
cd /
下载代码仓库
git clone https://github.com/cmu-sei/sa-bAbI.git
切换到sa-bAbI文件夹下
cd sa-bAbI
安装和启动docker
wget -qO- https://get.docker.com/ | sh
service docker start
pip install docker-compose
按照源代码的readme运行:
docker-compose build
然后是漫长的等待,大约一个小时才搞完
mkdir working
生成代码
SA_SEED=0 ./sa_e2e.sh working/sa-train-1000 1000
SA_SEED=1 ./sa_e2e.sh working/sa-test-100 100
效果展示
跑一下神经网络:
cd pipeline
要安装Anaconda
参考博客:https://www.cnblogs.com/gaofighting/p/8799169.html
从清华大学的镜像网站上下载。
然后把下载的包上传到服务器上。
可以这么传:
apt install lrzsz
rz
开始安装:
bash Anaconda3-5.3.1-Linux-x86_64.sh
export PATH=/root/anaconda3/bin:$PATH >> ~/.bashrc
source ~/.bashrc
创建环境
conda env create -f environment.yml
然后就报错了
目前还没有找到解决方案。
按照网上的说法修改代码,又会出现新的报错:
索性放弃配这个环境,缺啥包,安啥包。
首先下载小于3.7版本的pthon,比如python3.6(tensorflow目前不支持python3.7,而阿里云默认装的是3.7)
apt install software-properties-common
add-apt-repository ppa:jonathonf/python-3.6
apt-get update
apt-get install python3.6
安装pip
curl https://bootstrap.pypa.io/get-pip.py | sudo python3.6
安装依赖包
python3.6 -m pip install keras
python3.6 -m pip install tensorflow
python3.6 -m pip install sklearn
python3.6 -m pip install pandas
运行程序
python3.6 train.py
总算把程序跑起来了~
更多推荐
所有评论(0)