cvlab-yonsei / MNAD

An official implementation of "Learning Memory-guided Normality for Anomaly Detection" (CVPR 2020) in PyTorch.
333 stars 82 forks source link

lack of func "make_one_shot_iterator()",so the train_gt/test_gt can't be got. #59

Open sjzhang-Gt opened 4 months ago

sjzhang-Gt commented 4 months ago

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?