开源AI药物发现TorchDrug安装测试的那些坑
安装调试杂记,有点乱。
有人或者AI查找解决方案的时候能够搜索到,能够对其有所帮助就好了。
供参考。
平台
Windows 7 SP1 X64 On X64
TorchDrug介绍
华人团队开源「通用型」AI药物发现平台,图表示学习的「杀手级」应用在生物医药?丨专访MILA唐建|制药|AI
https://www.163.com/dy/article/GHTUH1RU0532PL1J.html
C:\makeGoTest>pip3 install torch
C:\makeGoTest>python -c "import torch; print(torch.version")
1.9.1+cpu
C:\makeGoTest>nvidia-smi
Tue Sep 28 14:41:34 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 441.08 Driver Version: 441.08 CUDA Version: 10.2
install torch-scatter
pip3 install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.1+cu102.html
pip3 install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.1+cu102.html --proxy=127.0.0.1:xxxx
pip3 install torchdrug
来自 https://torchdrug.ai/docs/installation.html
CUDA Toolkit 10.2 Download | NVIDIA Developer
https://developer.nvidia.com/cuda-10.2-download-archive?target_os=Windows&target_arch=x86_64&target_version=7&target_type=exenetwork
G:\work3\TorchDrugX>python graphx.py
G:\work3\TorchDrugX>set CUDA_HOME='C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2'
Microsoft Visual C++ 14.0
pip3 install torch==1.9.1+cu102 torchvision==0.10.1+cu102 torchaudio===0.9.1 -f https://download.pytorch.org/whl/torch_stable.html
来自 <https://pytorch.org/get-started/locally/>
Looking in links: https://download.pytorch.org/whl/torch_stable.html
Collecting torch==1.9.1+cu102
Downloading https://download.pytorch.org/whl/cu102/torch-1.9.1%2Bcu102-cp38-cp38-win_amd64.whl (1440.5 MB)
Looking in links: https://download.pytorch.org/whl/torch_stable.html
Collecting torch==1.9.1+cu102
Downloading https://download.pytorch.org/whl/cu102/torch-1.9.1%2Bcu102-cp38-cp38-win_amd64.whl (1440.5 MB)
|████████████████████████████████| 1440.5 MB 832 bytes/s
Collecting torchvision==0.10.1+cu102
Downloading https://download.pytorch.org/whl/cu102/torchvision-0.10.1%2Bcu102-cp38-cp38-win_amd64.whl (2.1 MB)
|████████████████████████████████| 2.1 MB 3.3 MB/s
Collecting torchaudio===0.9.1
Downloading torchaudio-0.9.1-cp38-cp38-win_amd64.whl (216 kB)
|████████████████████████████████| 216 kB 656 kB/s
C:\PROGRA~1\python38\lib\site-packages\torch\utils\cpp_extension.py:305: UserWarning: Error checking compiler version for cl: [WinError 2] 系统找不到指定的文件。
这个在线安装包运行过程无法下载网络数据。
Microsoft Build Tools 2015 Update 3
用來建置 Managed 應用程式的基本工具。 之前包含在 .NET Framework 中,現在已經在此提供個別下載使用。
来自 https://visualstudio.microsoft.com/zh-hant/vs/older-downloads/
还是要用VS的installer工具。
pip install pytorch-ext
来自 https://www.cnpython.com/pypi/pytorch-ext
pip install git+https://github.com/AlbertoCenzato/pytorch_ext.git
来自 https://blog.csdn.net/tandelin/article/details/103664721
通过pip安装Pytorch报错ImportError: DLL load failed: 找不到指定的模块解决办法_taxuezcy的博客-CSDN博客
https://blog.csdn.net/taxuezcy/article/details/80741315?utm_medium=distribute.pc_relevant.none-task-blog-2defaultbaidujs_baidulandingword~default-0.no_search_link&spm=1001.2101.3001.4242
解决方法
将Visual Studio中cl.exe所在的目录添加到系统变量中的Path变量,即可解决问题,例如:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64,如下图所示:
来自 https://blog.csdn.net/discoverer100/article/details/101626615
set PATH=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\Hostx64\x64
来自 https://www.shellhacks.com/windows-cmd-path-variable-add-to-path-echo-path/
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd3 in position 1316: invalid con
windows系统下python setup.py install ---出现cl问题,cpp_extension.py:237: UserWarning: Error checking compiler version for cl: 'utf-8' codec can't decode byte 0xd3 in position 0: invalid continuation byte - yunshangyue - 博客园
https://www.cnblogs.com/yunshangyue71/p/13215606.html
添加('gbk')
Releases · ninja-build/ninja
https://github.com/ninja-build/ninja/releases
set PATH=%PATH%;C:\Users\swang\workwork\LIBWORK\lib\ninja-win
VS2019—crtdbg.h: No such file or directory
原文链接
推测是缺少必要的库文件 SDK编译条件表
首先看有没有安装windows sdk,如果没有安装, 请打开visual Studio Installer,然后选择修改,勾上最新版的windows SDK
11:23:09 Epoch 45 begin
11:23:14 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
11:23:14 Epoch 45 end
11:23:14 duration: 5.67 secs
11:23:14 speed: 0.35 batch / sec
11:23:14 ETA: 5.47 mins
11:23:14 max GPU memory: 0.0 MiB
11:23:14 ------------------------------
11:23:14 average binary cross entropy: 0.261928
11:23:14 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
11:23:14 Epoch 46 begin
Hierarchical Interface
TorchDrug is designed to cater all kinds of development. It has a hierarchical interface, which ranges from low-level data structures and operations, mid-level layers and models, to high-level tasks. We can easily customize modules at any level with minimal efforts by utilizing building blocks from a lower level.
来自 https://torchdrug.ai/get_started
Iteration
Iteration是batch需要完成一个epoch的次数。
举个例子:
有一个2000个训练样本的数据集。将2000个样本分成大小为500的batch,那么完成一个epoch需要4个iteration。
来自 https://blog.csdn.net/program_developer/article/details/78597738
pip install git+https://github.com/ipython-contrib/jupyter_contrib_nbextensions.git