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

Cannot train because of the lack of func "make_one_shot_iterator()" #71

Open sjzhang-Gt opened 2 months ago

sjzhang-Gt commented 2 months ago

lack of func "make_one_shot_iterator()""get_next()",so the train_gt/test_gt can't be got. in train.py ,there is

"with tf.name_scope('dataset'): train_loader = DataLoader(train_folder, resize_height=height, resize_width=width) train_dataset = train_loader(batch_size=batch_size, time_steps=num_his, num_pred=1)

train_it = train_dataset.make_one_shot_iterator() train_videos_clips_tensor = train_it.get_next() train_videos_clips_tensor.set_shape([batch_size, height, width, 3*(num_his + 1)])

train_inputs = train_videos_clips_tensor[..., 0:num_his*3] train_gt = train_videos_clips_tensor[..., -3:]

print('train inputs = {}'.format(train_inputs)) print('train prediction gt = {}'.format(train_gt))

test_loader = DataLoader(test_folder, resize_height=height, resize_width=width) test_dataset = test_loader(batch_size=batch_size, time_steps=num_his, num_pred=1) test_it = test_dataset.make_one_shot_iterator() test_videos_clips_tensor = test_it.get_next() test_videos_clips_tensor.set_shape([batch_size, height, width, 3*(num_his + 1)])

test_inputs = test_videos_clips_tensor[..., 0:num_his*3] test_gt = test_videos_clips_tensor[..., -3:]" however,there is no "make_one_shot_iterator()""get_next()""set_shape" in whole project. Could you please add the above code?