论文:
https://arxiv.org/abs/2004.05150
首先保证电脑上配置了git.
git环境配置:
https://blog.csdn.net/Andone_hsx/article/details/87937329
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 3.1、找到git安装路径中bin的位置,如:D:\Program Files\Git\bin 找到git安装路径中git-core的位置,如:D:\Program Files\Git\libexec\git-core; 注:"D:\Program Files\Git\"是安装路径,可能与你的安装路径不一样,要按照你自己的路径替换"D:\Program Files\Git\" 3.2、右键"计算机"->"属性"->"高级系统设置"->"环境变量"->在下方的"系统变量"中找到"path"->选中"path"并选择"编辑"->将 3.1中找到的bin和git-core路径复制到其中->保存并退出 注:"path"中,每个路径之间要以英文输入状态下的分号------";"作为间隔 |
| D:\Program Files\Git\mingw64\bin D:\Program Files\Git\mingw64\libexec\git-core |
安装环境
|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| conda create --name longformer python=3.7 y conda activate longformer conda install cudatoolkit=10.0 y pip install git+https://github.com/allenai/longformer.git |
报错:
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ERROR: Could not find a version that satisfies the requirement pandas>=0.20.3 (from test-tube) (from versions: none) ERROR: No matching distribution found for pandas>=0.20.3 |
| No module named 'pandas' |
Install装不上, 在anaconda navigator装的
更换清华源后似乎可以继续运行了, 参考:
https://www.cnblogs.com/raiuny/p/15950043.html
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| conda config --add channels Index of /anaconda/cloud/pytorch/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror conda config --set show_channel_urls yes conda config --set auto_activate_base false pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple |
好几次报错128, 也许是RP问题, 总之重新运行几次后安装成功了.
环境安装成功会显示successful.
接着跑tests文件夹的test_readme.py, 注意需要下载longformer-base-4096.tar.gz
这个文件我放在项目目录下的/tmp文件夹和tests/tmp都无法读取, 因此修改了self.model_dir路径为绝对路径, 并注释下载解压代码, 就可以运行了: