使用 ActionVLAD 时出现 TensorFlow 错误 "unable to get element from the feed as bytes"
TensorFlow error "unable to get element from the feed as bytes" when using ActionVLAD
我使用 Anaconda 安装了 TensorFlow r0.12,并从动作检测算法 ActionVLAD 中执行 run.sh
文件:
然后我得到了这个错误回溯:
tensorflow.python.framework.errors_impl.InternalError:
Unable to get element from the feed as bytes.
Traceback (most recent call last):
File "get_class.py", line 7, in
with h5py.File(sys.argv[1], 'r') as fin, open(sys.argv[2], 'r') as fin2:
File "/Users/wuhaoyang/anaconda2/envs/tf_v0.12.0rc0/lib/python2.7/site-packages/h5py/_hl/files.py", line 271, in init
fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
File "/Users/wuhaoyang/anaconda2/envs/tf_v0.12.0rc0/lib/python2.7/site-packages/h5py/_hl/files.py", line 101, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/private/var/folders/my/m6ynh3bn6tq06h7xr3js0z7r0000gn/T/pip-wdzlRM-build/h5py/_objects.c:2840)
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/private/var/folders/my/m6ynh3bn6tq06h7xr3js0z7r0000gn/T/pip-wdzlRM-build/h5py/_objects.c:2798)
File "h5py/h5f.pyx", line 78, in h5py.h5f.open (/private/var/folders/my/m6ynh3bn6tq06h7xr3js0z7r0000gn/T/pip-wdzlRM-build/h5py/h5f.c:2117)
IOError: Unable to open file (Unable to open file: name = '/tmp/actionvlad-demo/feats.h5', errno = 2, error message = 'no such file or directory', flags = 0, o_flags = 0)
如何解决这个问题并使 ActionVLAD 与 TensorFlow r0.12 一起工作?
请参阅 Github 上已关闭的问题 #3。
问题是预训练模型的输入路径设置错误,导致TensorFlow无法加载预训练模型。解决方法是将文件demo/ext_feats.sh
中的--checkpoint_path
改为下载的checkpoint文件。这已在 this commit 中修复。
我使用 Anaconda 安装了 TensorFlow r0.12,并从动作检测算法 ActionVLAD 中执行 run.sh
文件:
然后我得到了这个错误回溯:
tensorflow.python.framework.errors_impl.InternalError:
Unable to get element from the feed as bytes.
Traceback (most recent call last):
File "get_class.py", line 7, in
with h5py.File(sys.argv[1], 'r') as fin, open(sys.argv[2], 'r') as fin2:
File "/Users/wuhaoyang/anaconda2/envs/tf_v0.12.0rc0/lib/python2.7/site-packages/h5py/_hl/files.py", line 271, in init
fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
File "/Users/wuhaoyang/anaconda2/envs/tf_v0.12.0rc0/lib/python2.7/site-packages/h5py/_hl/files.py", line 101, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/private/var/folders/my/m6ynh3bn6tq06h7xr3js0z7r0000gn/T/pip-wdzlRM-build/h5py/_objects.c:2840)
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/private/var/folders/my/m6ynh3bn6tq06h7xr3js0z7r0000gn/T/pip-wdzlRM-build/h5py/_objects.c:2798)
File "h5py/h5f.pyx", line 78, in h5py.h5f.open (/private/var/folders/my/m6ynh3bn6tq06h7xr3js0z7r0000gn/T/pip-wdzlRM-build/h5py/h5f.c:2117)
IOError: Unable to open file (Unable to open file: name = '/tmp/actionvlad-demo/feats.h5', errno = 2, error message = 'no such file or directory', flags = 0, o_flags = 0)
如何解决这个问题并使 ActionVLAD 与 TensorFlow r0.12 一起工作?
请参阅 Github 上已关闭的问题 #3。
问题是预训练模型的输入路径设置错误,导致TensorFlow无法加载预训练模型。解决方法是将文件demo/ext_feats.sh
中的--checkpoint_path
改为下载的checkpoint文件。这已在 this commit 中修复。