gpt4 book ai didi

python - LSTM 中的长期递归卷积网络论文复制错误?

转载 作者:太空宇宙 更新时间:2023-11-03 11:47:19 27 4
gpt4 key购买 nike

我正在尝试重现 Long-term Recurrent Convolutional Networks paper.

我用过他们的given code .并按照他们的指示生成了单帧模型。但是当尝试训练 LSTM 混合网络时它失败了。我已经按照 instructions. 中的说明进行了必要的更改

我运行的命令是 caffe train -solver lstm_solver_flow.prototxt -weights singleframe_flow/snaps/snapshots_singleFrame_flow_v2_iter_50000.caffemodel我得到的输出是

I0323 18:16:30.685951  9123 net.cpp:205] This network produces output loss
I0323 18:16:30.685967 9123 net.cpp:446] Collecting Learning Rate and Weight Decay.
I0323 18:16:30.685976 9123 net.cpp:218] Network initialization done.
I0323 18:16:30.685982 9123 net.cpp:219] Memory required for data: 817327112
I0323 18:16:30.686339 9123 solver.cpp:42] Solver scaffolding done.
I0323 18:16:30.686388 9123 caffe.cpp:86] Finetuning from singleframe_flow/snaps/snapshots_singleFrame_flow_v2_iter_50000.caffemodel
I0323 18:16:33.377488 9123 solver.cpp:247] Solving lstm_joints
I0323 18:16:33.377518 9123 solver.cpp:248] Learning Rate Policy: step
I0323 18:16:33.391726 9123 solver.cpp:291] Iteration 0, Testing net (#0)
Traceback (most recent call last):
File "/home/anilil/projects/lstm/lisa-caffe-public/examples/LRCN_activity_recognition/sequence_input_layer.py", line 220, in forward
new_result_data = [None]*len(self.batch_advancer.result['data'])
KeyError: 'data'
terminate called after throwing an instance of 'boost::python::error_already_set'
*** Aborted at 1458753393 (unix time) try "date -d @1458753393" if you are using GNU date ***
PC: @ 0x7f243731bcc9 (unknown)
*** SIGABRT (@0x23a3) received by PID 9123 (TID 0x7f24389077c0) from PID 9123; stack trace: ***
@ 0x7f243731bd40 (unknown)
@ 0x7f243731bcc9 (unknown)
@ 0x7f243731f0d8 (unknown)
@ 0x7f2437920535 (unknown)
@ 0x7f243791e6d6 (unknown)
@ 0x7f243791e703 (unknown)
@ 0x7f243791e976 (unknown)
@ 0x7f2397bb5bfd caffe::PythonLayer<>::Forward_cpu()
@ 0x7f243821d87f caffe::Net<>::ForwardFromTo()
@ 0x7f243821dca7 caffe::Net<>::ForwardPrefilled()
@ 0x7f243822fd77 caffe::Solver<>::Test()
@ 0x7f2438230636 caffe::Solver<>::TestAll()
@ 0x7f243823837b caffe::Solver<>::Step()
@ 0x7f2438238d5f caffe::Solver<>::Solve()
@ 0x4071c8 train()
@ 0x405701 main
@ 0x7f2437306ec5 (unknown)
@ 0x405cad (unknown)
@ 0x0 (unknown)
run_lstm_flow.sh: line 8: 9123 Aborted (core dumped) GLOG_logtostderr=1 $TOOLS/caffe train -solver lstm_solver_flow.prototxt -weights singleframe_flow/snaps/snapshots_singleFrame_flow_v2_iter_50000.caffemodel
Done.

这是我改变的sequence_input_layer.pyprototext文件。我输入到网络的训练和测试文本是这个 format .

我认为主要问题是 ##rearrange the data:LSTM 将输入作为 [video0_frame0, video1_frame0,...] 但数据当前排列为 [video0_frame0, video0_frame1, ...]

我没能解决这个问题,这让我很困惑。但我可能错了。

最佳答案

我知道我来晚了,希望我的回答对以后的人有所帮助。我也遇到了同样的错误。问题出在 scikit-image 版本上。我使用的是比 scikit-image 0.9.3 更新的版本。下一行

processed_image = transformer.preprocess('data_in',data_in)

使用由 lisa-caffe-public-lstm_video_deploy/python/caffe/io.py 导入的 scikit-image 库函数。对于较新的版本,transformer.preprocess() 崩溃了,因此 processImageCrop() 函数没有返回,因此 KeyError: 'data'

简而言之,您应该使用 scikit-image-0.9.3 来消除错误 :)希望有所帮助:)

关于python - LSTM 中的长期递归卷积网络论文复制错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36185914/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com