iResNet icon indicating copy to clipboard operation
iResNet copied to clipboard

执行test_rob.py时,测试kitti,程序报错raise CalledProcessError(retcode, cmd, output=output)

Open zmzhaoming opened this issue 7 years ago • 2 comments

我使用预训练模型iResNet_ROB.caffemodel作为程序的输入参数,我想直接测试kitti中的数据,所以我的主函数为: if name == 'main':

caffemodel = sys.argv[1]    
training_dataset_dir = os.path.join(dataset_dir,'training')
test_dataset_dir = os.path.join(dataset_dir,'test')  

# test kitti
dataset_name = 'Kitti2015'
# test set
RunMethod(caffemodel, submit_dir, test_dataset_dir, dataset_name, False)

当我执行到im0_size = get_image_size(im0)这一步时,即程序进入到get_image_size这个函数 def get_image_size(filename): global img_size_bin dim_list = [int(dimstr) for dimstr in str(subprocess.check_output([img_size_bin, filename])).split(',')] if not len(dim_list) == 2: print('Could not determine size of image %s' % filename) sys.exit(1) return dim_list 当执行到dim_list = [int(dimstr) for dimstr in str(subprocess.check_output([img_size_bin, filename])).split(',')]这一句时,程序报出了如下的错误: Traceback (most recent call last): File "/home/huangchao/Downloads/pycharm-2017.3.2/helpers/pydev/pydevd.py", line 1668, in main() File "/home/huangchao/Downloads/pycharm-2017.3.2/helpers/pydev/pydevd.py", line 1662, in main globals = debugger.run(setup['file'], None, None, is_module) File "/home/huangchao/Downloads/pycharm-2017.3.2/helpers/pydev/pydevd.py", line 1072, in run pydev_imports.execfile(file, globals, locals) # execute the script File "/home/huangchao/MyWorkspace/Resource_iResNet/iResNet-master/models/test_rob.py", line 252, in RunMethod(caffemodel, submit_dir, test_dataset_dir, dataset_name, False) File "/home/huangchao/MyWorkspace/Resource_iResNet/iResNet-master/models/test_rob.py", line 119, in RunMethod im0_size = get_image_size(im0) File "/home/huangchao/MyWorkspace/Resource_iResNet/iResNet-master/models/test_rob.py", line 38, in get_image_size dim_list = [int(dimstr) for dimstr in str(subprocess.check_output([img_size_bin, filename])).split(',')] File "/home/huangchao/anaconda2/lib/python2.7/subprocess.py", line 219, in check_output raise CalledProcessError(retcode, cmd, output=output) subprocess.CalledProcessError: Command '['/home/huangchao/caffe/build/tools/get_image_size', '/home/huangchao/caffe/data/datasets_middlebury2014/test/Kitti2015_000071_10/im0.png']' returned non-zero exit status 1

Process finished with exit code 1 请问这个问题该如何解决呢?求帮助啊

zmzhaoming avatar Jul 27 '18 07:07 zmzhaoming

@zmzhaoming 这个问题我没遇到过,你可以试试单步调试进去,看看哪里有不正确的,是不是图片读错了。。。或者你注释掉get_image_size那两行,然后手动设置一下图片的大小。。

leonzfa avatar Aug 05 '18 19:08 leonzfa

@zmzhaoming 你的问题解决了吗?我也想测试kitti,能否分享一下经验,vx:464374800 谢谢啦

jianrui1 avatar Mar 20 '19 15:03 jianrui1