我是一个初学者,试图评估这篇视频对象分割网络论文
按照https://github.com/seoungwugoh/STM上的说明操作时
它说,要求如下:
python 3.6
pytorch 1.0.1.post2
numpy, opencv, pillow
我无法安装这个pytorch版本,所以我安装了conda forge pytorch版本1.5
我使用Anaconda在Windows10或Ubuntu16.04中运行这个命令
(STMVOS) oneworld@oneworld:~/Documents/VideoObjectSegmentation/STMVOS$ python eval_DAVIS.py -g '1' -s val -y 16 -D ../DAVISSemiSupervisedTrainVal480
完成pip安装matplotlib和pip安装TQM后
我收到以下错误消息:-
时空内存网络:已初始化。 STM:在DAVIS上测试 装载重量:STM_weights.pth 回溯(最近一次呼叫最后一次):
文件“eval_DAVIS.py”,第111行,在 模型荷载状态(火炬荷载(pth路径))
文件“/home/oneworld/anaconda3/envs/STMVOS/lib/python3.8/site packages/torch/serialization.py”,第593行,已加载 返回\u旧版\u加载(打开的\u文件、映射\u位置、pickle\u模块、**pickle\u加载\u参数)
文件“/home/oneworld/anaconda3/envs/STMVOS/lib/python3.8/site-packages/torch/serialization.py”,第773行,在旧版加载中 结果=unpickler.load()
文件“/home/oneworld/anaconda3/envs/STMVOS/lib/python3.8/site packages/torch/serialization.py”,第729行,持续加载
反序列化的\u对象[根\u键]=还原\u位置(obj,位置)
文件“/home/oneworld/anaconda3/envs/STMVOS/lib/python3.8/site packages/torch/serialization.py”,第178行,默认位置 结果=fn(存储、位置)
文件“/home/oneworld/anaconda3/envs/STMVOS/lib/python3.8/site packages/torch/serialization.py”,第154行,反序列化 设备=验证\u cuda\u设备(位置)
文件“/home/oneworld/anaconda3/envs/STMVOS/lib/python3.8/site packages/torch/serialization.py”,第138行,在validate_cuda_device raise RuntimeError('尝试反序列化cuda上的对象'
RuntimeError:尝试反序列化CUDA设备上的对象,但torch.CUDA.is_available()为False。如果您在仅CPU的计算机上运行,请使用torch.load with map_location=torch.device('CPU')将存储映射到CPU
我的图形卡驱动程序、系统和软件包如下:-
(STMVOS) oneworld@oneworld:~/Documents/VideoObjectSegmentation/STMVOS$ nvidia-smi
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.64.00 Driver Version: 440.64.00 CUDA Version: 10.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 1070 Off | 00000000:01:00.0 On | N/A |
| 26% 34C P8 10W / 151W | 392MiB / 8118MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1247 G /usr/lib/xorg/Xorg 229MiB |
| 0 2239 G compiz 126MiB |
| 0 9385 G /usr/lib/firefox/firefox 2MiB |
| 0 11686 G /proc/self/exe 30MiB |
+-----------------------------------------------------------------------------+
我也试过这个
(STMVOS) oneworld@oneworld:~/Documents/VideoObjectSegmentation/STMVOS$ python -c 'import torch; print(torch.rand(2,3).cuda())'
张量([[0.9178,0.8239,0.4761], [0.9429,0.8877,0.0097]],device='cuda:0')
这表明cuda在这里工作
(STMVOS) oneworld@oneworld:~/Documents/VideoObjectSegmentation/STMVOS$ conda info
active environment : STMVOS
active env location : /home/oneworld/anaconda3/envs/STMVOS
shell level : 1
user config file : /home/oneworld/.condarc
populated config files :
conda version : 4.8.2
conda-build version : 3.18.11
python version : 3.7.6.final.0
virtual packages : __cuda=10.2
__glibc=2.23
base environment : /home/oneworld/anaconda3 (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /home/oneworld/anaconda3/pkgs
/home/oneworld/.conda/pkgs
envs directories : /home/oneworld/anaconda3/envs
/home/oneworld/.conda/envs
platform : linux-64
user-agent : conda/4.8.2 requests/2.22.0 CPython/3.7.6 Linux/4.4.0-179-generic ubuntu/16.04.6 glibc/2.23
UID:GID : 1000:1000
netrc file : None
offline mode : False
(STMVOS) oneworld@oneworld:~/Documents/VideoObjectSegmentation/STMVOS$ conda list
在/home/oneworld/anaconda3/envs/STMVOS环境中的包:
Name Version Build Channel
_libgcc_mutex 0.1 main
blas 1.0 mkl
bzip2 1.0.8 h516909a_2 conda-forge
ca-certificates 2020.4.5.1 hecc5488_0 conda-forge
cairo 1.16.0 hcf35c78_1003 conda-forge
certifi 2020.4.5.1 py38_0
cudatoolkit 10.2.89 hfd86e86_1
cycler 0.10.0 pypi_0 pypi
dbus 1.13.6 he372182_0 conda-forge
expat 2.2.9 he1b5a44_2 conda-forge
ffmpeg 4.2.3 h167e202_0 conda-forge
fontconfig 2.13.1 h86ecdb6_1001 conda-forge
freetype 2.9.1 h8a8886c_1
gettext 0.19.8.1 hc5be6a0_1002 conda-forge
giflib 5.2.1 h516909a_2 conda-forge
glib 2.64.3 h6f030ca_0 conda-forge
gmp 6.2.0 he1b5a44_2 conda-forge
gnutls 3.6.5 hd3a4fd2_1002 conda-forge
graphite2 1.3.13 he1b5a44_1001 conda-forge
gst-plugins-base 1.14.5 h0935bb2_2 conda-forge
gstreamer 1.14.5 h36ae1b5_2 conda-forge
harfbuzz 2.4.0 h9f30f68_3 conda-forge
hdf5 1.10.6 nompi_h3c11f04_100 conda-forge
icu 64.2 he1b5a44_1 conda-forge
intel-openmp 2020.1 217
jasper 1.900.1 h07fcdf6_1006 conda-forge
jpeg 9c h14c3975_1001 conda-forge
kiwisolver 1.2.0 pypi_0 pypi
lame 3.100 h14c3975_1001 conda-forge
ld_impl_linux-64 2.33.1 h53a641e_7
libblas 3.8.0 15_mkl conda-forge
libcblas 3.8.0 15_mkl conda-forge
libclang 9.0.1 default_hde54327_0 conda-forge
libedit 3.1.20181209 hc058e9b_0
libffi 3.2.1 he1b5a44_1007 conda-forge
libgcc-ng 9.1.0 hdf63c60_0
libgfortran-ng 7.3.0 hdf63c60_0
libiconv 1.15 h516909a_1006 conda-forge
liblapack 3.8.0 15_mkl conda-forge
liblapacke 3.8.0 15_mkl conda-forge
libllvm9 9.0.1 he513fc3_1 conda-forge
libopencv 4.2.0 py38_6 conda-forge
libpng 1.6.37 hbc83047_0
libstdcxx-ng 9.1.0 hdf63c60_0
libtiff 4.1.0 h2733197_0
libuuid 2.32.1 h14c3975_1000 conda-forge
libwebp 1.0.2 h56121f0_5 conda-forge
libxcb 1.13 h14c3975_1002 conda-forge
libxkbcommon 0.10.0 he1b5a44_0 conda-forge
libxml2 2.9.10 hee79883_0 conda-forge
matplotlib 3.2.1 pypi_0 pypi
mkl 2020.1 217
mkl-service 2.3.0 py38he904b0f_0
mkl_fft 1.0.15 py38ha843d7b_0
mkl_random 1.1.1 py38h0573a6f_0
ncurses 6.2 he6710b0_1
nettle 3.4.1 h1bed415_1002 conda-forge
ninja 1.9.0 py38hfd86e86_0
nspr 4.25 he1b5a44_0 conda-forge
nss 3.47 he751ad9_0 conda-forge
numpy 1.18.1 py38h4f9e942_0
numpy-base 1.18.1 py38hde5b4d6_1
olefile 0.46 py_0
opencv 4.2.0 py38_6 conda-forge
openh264 2.1.1 h8b12597_0 conda-forge
openssl 1.1.1g h516909a_0 conda-forge
pcre 8.44 he1b5a44_0 conda-forge
pillow 7.1.2 py38hb39fc2d_0
pip 20.0.2 py38_3
pixman 0.38.0 h516909a_1003 conda-forge
pthread-stubs 0.4 h14c3975_1001 conda-forge
py-opencv 4.2.0 py38h23f93f0_6 conda-forge
pyparsing 2.4.7 pypi_0 pypi
python 3.8.1 h0371630_1
python-dateutil 2.8.1 pypi_0 pypi
python_abi 3.8 1_cp38 conda-forge
pytorch 1.5.0 py3.8_cuda10.2.89_cudnn7.6.5_0 pytorch
qt 5.12.5 hd8c4c69_1 conda-forge
readline 7.0 h7b6447c_5
setuptools 46.4.0 py38_0
six 1.14.0 py38_0
sqlite 3.31.1 h62c20be_1
tk 8.6.8 hbc83047_0
torchvision 0.6.0 py38_cu102 pytorch
tqdm 4.46.0 pypi_0 pypi
wheel 0.34.2 py38_0
x264 1!152.20180806 h14c3975_0 conda-forge
xorg-kbproto 1.0.7 h14c3975_1002 conda-forge
xorg-libice 1.0.10 h516909a_0 conda-forge
xorg-libsm 1.2.3 h84519dc_1000 conda-forge
xorg-libx11 1.6.9 h516909a_0 conda-forge
xorg-libxau 1.0.9 h14c3975_0 conda-forge
xorg-libxdmcp 1.1.3 h516909a_0 conda-forge
xorg-libxext 1.3.4 h516909a_0 conda-forge
xorg-libxrender 0.9.10 h516909a_1002 conda-forge
xorg-renderproto 0.11.1 h14c3975_1002 conda-forge
xorg-xextproto 7.3.0 h14c3975_1002 conda-forge
xorg-xproto 7.0.31 h14c3975_1007 conda-forge
xz 5.2.5 h7b6447c_0
zlib 1.2.11 h7b6447c_3
zstd 1.3.7 h0b5b093_0
它在eval_DAVIS.py中被卡住的代码如下:-
print('Loading weights:', pth_path)
model.load_state_dict(torch.load(pth_path))
我正在使用Ubuntu16.04,但是我在Windows10中尝试了类似的设置,并收到了相同的错误消息
非常感谢您的帮助
问候
一个世界
我从3.8版更改了python版本。根据3.6,使用conda forge安装和重新安装matplotlib
我在MSVSCode中以调试模式运行代码eval_DAVIS.py,而不是从命令行注释参数,如下所示:-
越界
我写这篇文章是为了测试是否存在cuda可用的问题
这将生成以下终端日志
它到达这行代码
并提供以下错误消息:-
因此,这消除了CUDA错误,无需切换代码以使用CPU
但是,这仍然会产生冻结支持()错误
日志会识别数据加载程序错误:-
我刚刚为这个项目创建了
README.md
文件以便成功运行,它在这里:Install PyTorch via pip to run STM Paper。我已经在Windows10中使用Cuda版本10.1进行了测试。只要一步一步地遵循这个README.md
,你就可以开始了根据您的系统配置,PyTorch安装命令可能会有所不同,请获取安装命令,如下图所示:
您的
requirements.txt
文件应如下所示:注意:我没有对[path/to/DAVIS]或其他东西做任何操作。您可能能够在没有安装错误的情况下运行脚本
eval_DAVIS.py
,这就是我测试的全部内容。您也应该在Ubuntu
中运行,只需使用来自README.md
的适当命令即可快乐编码
因此,由于Python抛出的错误和建议
我试着编辑eval_DAVIS.py中111行的代码
对此
然后重新运行代码
通过重量加载
但是,当它开始测试时,会出现以下错误:-
这是使用Anaconda,因此下面的错误只是使用windows命令控制台和pip
我还将这段代码放在一个名为CUDATest.py的小文件中,以测试torch是否可以执行一个简单的矩阵乘法函数
我按如下方式运行代码:-
结果如下:
这表明我的CUDA和Pytorch工作正常
相关问题 更多 >
编程相关推荐