实验目标:复现TSN网络结果
代码:https://github.com/yjxiong/temporal-segment-networks
TSN介绍:https://zhuanlan.zhihu.com/p/32777430
到video-level testing这一步时:
python tools/eval_net.py ucf101 1 rgb FRAME_PATH \
models/ucf101/tsn_bn_inception_rgb_deploy.prototxt models/ucf101_split_1_tsn_rgb_reference_bn_inception.caffemodel \
--num_worker 4 --save_scores SCORE_FILE
出错:一、constructor returns null
libdc1394 error: Failed to initialize libdc1394
/usr/local/lib/python2.7/dist-packages/scipy/spatial/__init__.py:95: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
from .ckdtree import *
/usr/local/lib/python2.7/dist-packages/scipy/spatial/__init__.py:96: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
from .qhull import *
Namespace(caffe_path='./lib/caffe-action/', dataset='ucf101', flow_x_prefix='flow_x_', flow_y_prefix='flow_y_', frame_path='OutputImages', gpus=None, modality='rgb', net_proto='models/ucf101/tsn_bn_inception_rgb_deploy.prototxt', net_weights='models/ucf101_split_1_tsn_rgb_reference_bn_inception.caffemodel', num_frame_per_video=25, num_worker=4, rgb_prefix='img_', save_scores='Scores', split=1)
error: XDG_RUNTIME_DIR not set in the environment.
error: XDG_RUNTIME_DIR not set in the environment.
(eval_net.py:23248): Gdk-CRITICAL **: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
Traceback (most recent call last):
File "tools/eval_net.py", line 38, in
from pyActionRecog.action_caffe import CaffeNet
File "./pyActionRecog/action_caffe.py", line 4, in
import caffe
File "/root/caffe/python/caffe/__init__.py", line 1, in
from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer
File "/root/caffe/python/caffe/pycaffe.py", line 15, in
import caffe.io
File "/root/caffe/python/caffe/io.py", line 2, in
import skimage.io
File "/usr/local/lib/python2.7/dist-packages/skimage/io/__init__.py", line 15, in
reset_plugins()
File "/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py", line 95, in reset_plugins
_load_preferred_plugins()
File "/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py", line 75, in _load_preferred_plugins
_set_plugin(p_type, preferred_plugins['all'])
File "/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py", line 87, in _set_plugin
use_plugin(plugin, kind=plugin_type)
File "/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py", line 258, in use_plugin
_load(name)
File "/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py", line 302, in _load
fromlist=[modname])
File "/usr/local/lib/python2.7/dist-packages/skimage/io/_plugins/matplotlib_plugin.py", line 4, in
import matplotlib.pyplot as plt
File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 115, in
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/__init__.py", line 62, in pylab_setup
[backend_name], 0)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3agg.py", line 9, in
from . import backend_agg, backend_gtk3
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3.py", line 32, in
cursors.MOVE : Gdk.Cursor.new(Gdk.CursorType.FLEUR),
TypeError: constructor returned NULL
root@student3:~/temporal-segment-networks# ^C
root@student3:~/temporal-segment-networks# sudo ln /dev/null /dev/raw1394
ln: failed to create hard link ‘/dev/raw1394’ => ‘/dev/null’: Invalid cross-device link
root@student3:~/temporal-segment-networks# python tools/eval_net.py ucf101 1 rgb OutputImages models/ucf101/tsn_bn_inception_rgb_deploy.prototxt models/ucf101_split_1_tsn_rgb_reference_bn_inception.caffemodel --num_worker 4 --save_scores Scores
libdc1394 error: Failed to initialize libdc1394
/usr/local/lib/python2.7/dist-packages/scipy/spatial/__init__.py:95: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
from .ckdtree import *
/usr/local/lib/python2.7/dist-packages/scipy/spatial/__init__.py:96: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
from .qhull import *
Namespace(caffe_path='./lib/caffe-action/', dataset='ucf101', flow_x_prefix='flow_x_', flow_y_prefix='flow_y_', frame_path='OutputImages', gpus=None, modality='rgb', net_proto='models/ucf101/tsn_bn_inception_rgb_deploy.prototxt', net_weights='models/ucf101_split_1_tsn_rgb_reference_bn_inception.caffemodel', num_frame_per_video=25, num_worker=4, rgb_prefix='img_', save_scores='Scores', split=1)
error: XDG_RUNTIME_DIR not set in the environment.
error: XDG_RUNTIME_DIR not set in the environment.
(eval_net.py:23253): Gdk-CRITICAL **: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
Traceback (most recent call last):
File "tools/eval_net.py", line 38, in
from pyActionRecog.action_caffe import CaffeNet
File "./pyActionRecog/action_caffe.py", line 4, in
import caffe
File "/root/caffe/python/caffe/__init__.py", line 1, in
from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer
File "/root/caffe/python/caffe/pycaffe.py", line 15, in
import caffe.io
File "/root/caffe/python/caffe/io.py", line 2, in
import skimage.io
File "/usr/local/lib/python2.7/dist-packages/skimage/io/__init__.py", line 15, in
reset_plugins()
File "/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py", line 95, in reset_plugins
_load_preferred_plugins()
File "/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py", line 75, in _load_preferred_plugins
_set_plugin(p_type, preferred_plugins['all'])
File "/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py", line 87, in _set_plugin
use_plugin(plugin, kind=plugin_type)
File "/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py", line 258, in use_plugin
_load(name)
File "/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py", line 302, in _load
fromlist=[modname])
File "/usr/local/lib/python2.7/dist-packages/skimage/io/_plugins/matplotlib_plugin.py", line 4, in
import matplotlib.pyplot as plt
File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 115, in
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/__init__.py", line 62, in pylab_setup
[backend_name], 0)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3agg.py", line 9, in
from . import backend_agg, backend_gtk3
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3.py", line 32, in
cursors.MOVE : Gdk.Cursor.new(Gdk.CursorType.FLEUR),
TypeError: constructor returned NULL
解决方法:
sudo pip uninstall matplotlib
sudo apt-get install python-matplotlib
二、importError
ImportError: No module named google.protobuf.internal
解决方法:安装protobuf
conda install protobuf
或
sudo pip uninstall matplotlib
sudo apt-get install python-matplotlib
问题四、
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0816 03:26:23.363502 27051 common.cpp:158] Check failed: error == cudaSuccess (10 vs. 0) invalid device ordinal
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0816 03:26:23.363698 27049 common.cpp:158] Check failed: error == cudaSuccess (10 vs. 0) invalid device ordinal
*** Check failure stack trace: ***
*** Check failure stack trace: ***
ERROR google/protobuf/text_format.cc:245] Error parsing text-format caffe.NetParameter: 19:12: Message type "caffe.LayerParameter" has no field named "bn_param".
F0816 06:06:02.589454 34346 upgrade_proto.cpp:90] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: models/ucf101/tsn_bn_inception_rgb_deploy.prototxt
要解决的问题:
1、Message type "caffe.LayerParameter" has no field named "bn_param".
Solution:
可能的问题为运行的caffe版本有问题
把之前自己下的caffe给卸载,重新buildAll,在下面网址里发现作者对于这个问题的解答,万幸
https://github.com/yjxiong/temporal-segment-networks/issues/128#issuecomment-326541062
如果是按照github上的README操作的出问题,可能是libboost的版本问题
查看libboost版本:发现是1.54.0确实是低于1..55.0
libboost 升级:
$ sudo add-apt-repository ppa:boost-latest/ppa
$ sudo apt-get update
$ aptitude search boost
$ sudo apt-get install libboost1.55-dev(根据版本需要来定)
Error1:
解决:安装software-properties-common。输入命令:
apt-get install software-properties-common
Error2:-bash: aptitude: command not found
解决:
sudo apt-get install aptitude
Error3:
错误不间断...重新来过...直接安装openmpi,重新build_all
就可以了...