TextguidedATT icon indicating copy to clipboard operation
TextguidedATT copied to clipboard

Error while running run_inference using pretrained model

Open erastogi opened this issue 7 years ago • 5 comments

I get the following error when i run run_inference bash file : 'resNet/prediction_result/res_predictions_10NN_test5000.json'

Can you tell me how to reslove this ?

erastogi avatar Nov 08 '17 09:11 erastogi

"resNet/prediction_result/res_predictions_10NN_test5000.json" file consists of output captions obtained by running "run_evaluation.sh" on "TextguidedATT/002_inference/resNet/" and I wrote the run_inference.sh to run the run_evaluation.sh file automatically.

Can you check that you really have the output captions on the correct path?

JonghwanMun avatar Nov 08 '17 10:11 JonghwanMun

Hi, thanks for such an early response. You are right. I didn't have the file in correct path. When I try running run_extract_res.sh separately, I am facing issues with Cudnn library. I changed the params in the above to code to use 'nn' and not 'cudnn' but I still face the following error : " unknown Torch class <cudnn.SpatialConvolution>" . I am new to lua so I don't know much about it. Any ideas on why is it still going for cudnn ?

erastogi avatar Nov 08 '17 23:11 erastogi

I write train.lua file that trains models to use both 'cudnn' and 'nn', but layers of ResNet that I downloaded from "https://github.com/facebook/fb.resnet.torch" is constructed to use 'cudnn', thus you need to install cudnn on your environment. Refer https://github.com/soumith/cudnn.torch to install cudnn.

JonghwanMun avatar Nov 09 '17 05:11 JonghwanMun

@erastogi It seems that you should add require 'cudnn' in script ./000_data_construction/001_resNet101_conv_feat/extract_resnet_feat.lua.

vanpersie32 avatar Jan 24 '18 12:01 vanpersie32

I get the following error when i run run_inference bash file: -------------------------------------Evaluation kNN caption--------------------------------------- /home/sg/distro/install/bin/luajit: cannot open <data/resnet101_conv_feat_448/COCO_test2015_000000523573.t7> in mode r at /home/sg/distro/pkg/torch/lib/TH/THDiskFile.c:673 stack traceback: [C]: at 0x7f6fd6e1e720 [C]: in function 'DiskFile' /home/sg/distro/install/share/lua/5.1/torch/File.lua:405: in function 'load' eval_res_att_knn_testall.lua:161: in function 'eval_split' eval_res_att_knn_testall.lua:204: in main chunk [C]: in function 'dofile' .../sg/distro/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk [C]: at 0x00406670 ln: failed to create symbolic link ‘./data’: File exists ln: failed to create symbolic link ‘./coco-caption’: File exists ln: failed to create symbolic link ‘./tokenizer’: File exists Options are as follows Namespace(NN_info_path='data/coco/all_consensus_cap_testall_cider.json', eIdx=-1, eval_after_rerank=True, isTest=True, m=125, output_rank_1_cap='output/res_rank_1_cap_testall.json', output_ranked_caps='output/res_ranked_caps_testall.json', prediction_path='resNet/prediction_result/res_predictions_10NN_testall.json', rerank_mode='cider', sIdx=-1) Traceback (most recent call last): File "ranking_caps.py", line 40, in with open(opt.prediction_path, 'r') as f : IOError: [Errno 2] No such file or directory: 'resNet/prediction_result/res_predictions_10NN_testall.json'

swati1803 avatar Apr 09 '18 07:04 swati1803