1.DSMIL方法
(1).AttributeError: ‘version_info’ object has no attribute ‘version’
解决办法: pip install pyparsing==2.4.7
(2).解决GPU上运行pytorch代码的错误
python: symbol lookup error: /home/daichuangchuang/anaconda2/envs/dsmil/lib/python3.6/site-packages/torch/lib/libtorch_python.so: undefined symbol: PySlice_Unpack
解决办法:
a.首先原有的环境:pip freeze>requirements.txt
b.创建一个新的环境:conda create -n DSMIL python==3.6.2
c.激活新建的环境:conda activate DSMIL
d.安装原有环境中的所有包:pip install -r requirements.txt
e.原有的错误问题的得到解决。
(3).torch版本问题
Traceback (most recent call last):
File “train_tcga.py”, line 204, in
main()
File “train_tcga.py”, line 160, in main
state_dict_weights = torch.load(‘init.pth’)
File “/home/daichuangchuang/anaconda2/envs/DSMIL/lib/python3.6/site-packages/torch/serialization.py”, line 527, in load
with _open_zipfile_reader(f) as opened_zipfile:
File “/home/daichuangchuang/anaconda2/envs/DSMIL/lib/python3.6/site-packages/torch/serialization.py”, line 224, in init
super(_open_zipfile_reader, self).init(torch.C.PyTorchFileReader(name_or_buffer))
RuntimeError: version <= kMaxSupportedFileFormatVersion INTERNAL ASSERT FAILED at /pytorch/caffe2/serialize/inline_container.cc:132, please report a bug to PyTorch. Attempted to read a PyTorch file with version 3, but the maximum supported version for reading is 2. Your PyTorch installation may be too old. (init at /pytorch/caffe2/serialize/inline_container.cc:132)
frame #0: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x33 (0x7f03dc263193 in /home/daichuangchuang/anaconda2/envs/DSMIL/lib/python3.6/site-packages/torch/lib/libc10.so)
frame #1: caffe2::serialize::PyTorchStreamReader::init() + 0x1f5b (0x7f02aca0e9eb in /home/daichuangchuang/anaconda2/envs/DSMIL/lib/python3.6/site-packages/torch/lib/libtorch.so)
frame #2: caffe2::serialize::PyTorchStreamReader::PyTorchStreamReader(std::string const&) + 0x64 (0x7f02aca0fc04 in /home/daichuangchuang/anaconda2/envs/DSMIL/lib/python3.6/site-packages/torch/lib/libtorch.so)
frame #3: + 0x6c53a6 (0x7f03dd12d3a6 in /home/daichuangchuang/anaconda2/envs/DSMIL/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
frame #4: + 0x2961c4 (0x7f03dccfe1c4 in /home/daichuangchuang/anaconda2/envs/DSMIL/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
frame #38: __libc_start_main + 0xe7 (0x7f03e2273c87 in /lib/x86_64-linux-gnu/libc.so.6)
解决方法:
pip install torch==1.8.0 pip install torchvision==0.9.0
(4).运行错误
RuntimeError: CUDA error: CUBLAS_STATUS_INTERNAL_ERROR when calling cublasCreate(handle)
解决办法:需要重新安装对应的版本:
具体命令:
pip install torchvision==0.8.2 pip install torch==1.7.1
`



