StevenLiuWen / ano_pred_cvpr2018

Official implementation of Paper Future Frame Prediction for Anomaly Detection -- A New Baseline, CVPR 2018
433 stars 126 forks source link

AssertionError: ground true does not match the number of testing videos. 21 != 36 #48

Closed huangpan2507 closed 4 years ago

huangpan2507 commented 4 years ago

I do step 3. Testing on saved models(I have download pretraines model and tar -xvf it into Codes file)

Then run
<<<python inference.py --dataset ped1 \ --test_folder ../Data/ped1/testing/frames \ --gpu 1 \ --snapshot_dir checkpoints/pretrains/ped1

the problem comes like bellow: <<<video = 36 / 36, i = 199 / 200, psnr = 36.892002 total time = 225.26929545402527, fps = 31.961745987124253 Traceback (most recent call last): File "inference.py", line 149, in inference_func(snapshot_dir, dataset_name, evaluate_name) File "inference.py", line 101, in inference_func results = evaluate.evaluate(evaluate_name, pickle_path) File "/home/huangpan/git_download/Anomaly_Detection/Codes/evaluate.py", line 560, in evaluate optimal_results = eval_func(save_file) File "/home/huangpan/git_download/Anomaly_Detection/Codes/evaluate.py", line 405, in compute_auc dataset, psnr_records, gt = load_psnr_gt(loss_file=sub_loss_file) File "/home/huangpan/git_download/Anomaly_Detection/Codes/evaluate.py", line 256, in load_psnr_gt gt = gt_loader(dataset=dataset) File "/home/huangpan/git_download/Anomaly_Detection/Codes/evaluate.py", line 118, in call gt = self.load_ucsd_avenue_subway_gt(dataset) File "/home/huangpan/git_download/Anomaly_Detection/Codes/evaluate.py", line 137, in load_ucsd_avenue_subway_gt .format(num_video, len(video_list)) AssertionError: ground true does not match the number of testing videos. 21 != 36

Who can tell me how to solve it?

zachluo commented 4 years ago

@huangpan2507 Did you mix up the Ped1 and the Ped2? or the training set and the testing set?

huangpan2507 commented 4 years ago

Thank you for reminding me,I will check it.@zachluo

huangpan2507 commented 4 years ago

By the way, the step 2 Download Dataset : I have't download the shanghaitech.tar.gz file. because my device don't have enough space. So that error( like testing number not match ground truth number) , Is this the cause of the problem?? Looking forward to your reply, thank you!

I known the reason. Thank you for your kind reply

jinbo8 commented 2 years ago

I tried to inference myself datasets and meet the same problem with you , I found not more informations about it from BaiDu and Google, what did you do to resolve it ? hope your help , best wishes to you!