Open Aming1998 opened 2 years ago
python 3.7 cuda10、 cudnn 7.6.5
@Aming1998 可以将image name加入fetch_list中返回即可
@Aming1998 可以将image name加入fetch_list中返回即可
keys, values, _ = parse_fetches(test_fetches, infer_prog, extra_keys)
loader.start() outs = exe.run(infer_prog, fetch_list=values, return_numpy=False) res = { k: (np.array(v), v.recursive_sequence_lengths()) for k, v in zip(keys, outs) }
loader.reset()根据您刚才的提示 我已经明白了valus应该就是指图片路径的意思?那么这个地方的keys是什么含义呢? 需要修改吗?我感觉它俩是对应的关系
@Aming1998 可以将image name加入fetch_list中返回即可 save = FLAGS.save_dir + imgrename + '' + str(slice_idx) + '.jpg' outs = exe.run(infer_prog, fetch_list=save, return_numpy=False) res = { k: (np.array(v), v.recursive_sequence_lengths()) for k, v in zip(keys, outs) } 我直接将路径输入会出现这样的报错
/usr/local/lib/python2.7/dist-packages/paddle/fluid/executor.py:774: UserWarning: The following exception is not an EOF exception.
"The following exception is not an EOF exception.")
Traceback (most recent call last):
File "tools/infer_paddle_try.py", line 447, in
0 std::string paddle::platform::GetTraceBackString<char const>(char const&&, char const, int)
1 paddle::platform::EnforceNotMet::EnforceNotMet(std::__exception_ptr::exception_ptr, char const, int)
2 paddle::operators::FetchOp::RunImpl(paddle::framework::Scope const&, boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace, paddle::platform::CUDAPinnedPlace, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void> const&) const
3 paddle::framework::OperatorBase::Run(paddle::framework::Scope const&, boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace, paddle::platform::CUDAPinnedPlace, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void> const&)
4 paddle::framework::Executor::RunPreparedContext(paddle::framework::ExecutorPrepareContext, paddle::framework::Scope, bool, bool, bool)
5 paddle::framework::Executor::Run(paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool, std::vector<std::string, std::allocator
File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/framework.py", line 2426, in append_op
attrs=kwargs.get("attrs", None))
File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/executor.py", line 558, in _add_feed_fetch_ops
attrs={'col': i})
File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/executor.py", line 889, in _run_program
fetch_var_name=fetch_var_name)
File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/executor.py", line 817, in _run_impl
use_program_cache=use_program_cache)
File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/executor.py", line 770, in run
use_program_cache=use_program_cache)
File "tools/infer_paddle_try.py", line 281, in get_test_images
return_numpy=False)
File "tools/infer_paddle_try.py", line 372, in main
get_test_images(FLAGS)
File "tools/infer_paddle_try.py", line 447, in
PaddleCheckError: Cannot find fetch variable in scope, fetch_var_name is save_img/00001_1.jpg at [/paddle/paddle/fluid/operators/controlflow/fetch_op.cc:38] [operator < fetch > error]
@Aming1998 不是直接的图片路径,因为网络中无法输出图片路径,由于release/0.1的代码太老,你可以更新到0.2的分支吗?在0.2之后就支持了设置shuffle的字段:https://github.com/PaddlePaddle/PaddleDetection/blob/release/0.2/configs/yolov3_reader.yml https://github.com/PaddlePaddle/PaddleDetection/blob/release/0.2/ppdet/data/reader.py#L190
@Aming1998 不是直接的图片路径,因为网络中无法输出图片路径,由于release/0.1的代码太老,你可以更新到0.2的分支吗?在0.2之后就支持了设置shuffle的字段:https://github.com/PaddlePaddle/PaddleDetection/blob/release/0.2/configs/yolov3_reader.yml https://github.com/PaddlePaddle/PaddleDetection/blob/release/0.2/ppdet/data/reader.py#L190
好的 不过能请问一下 是否能够对test_feed.dataset 这个类进行清空操作呢 这样的话 对于我们来说可能会更加地方便一些。
PaddleDetection team appreciate any suggestion or problem you delivered~
Checklist:
描述问题/Describe the bug
A clear and concise description of what the bug is.
复现/Reproduction