Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Update train.py #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def validate():

F_t_0_f = intrpOut[:, :2, :, :] + F_t_0
F_t_1_f = intrpOut[:, 2:4, :, :] + F_t_1
V_t_0 = F.sigmoid(intrpOut[:, 4:5, :, :])
V_t_0 = torch.sigmoid(intrpOut[:, 4:5, :, :])
V_t_1 = 1 - V_t_0

g_I0_F_t_0_f = validationFlowBackWarp(I0, F_t_0_f)
Expand Down Expand Up @@ -218,9 +218,6 @@ def validate():
valPSNR.append([])
iLoss = 0

# Increment scheduler count
scheduler.step()

for trainIndex, (trainData, trainFrameIndex) in enumerate(trainloader, 0):

## Getting the input and the target from the training set
Expand Down Expand Up @@ -255,7 +252,7 @@ def validate():
# Extract optical flow residuals and visibility maps
F_t_0_f = intrpOut[:, :2, :, :] + F_t_0
F_t_1_f = intrpOut[:, 2:4, :, :] + F_t_1
V_t_0 = F.sigmoid(intrpOut[:, 4:5, :, :])
V_t_0 = torch.sigmoid(intrpOut[:, 4:5, :, :])
V_t_1 = 1 - V_t_0

# Get intermediate frames from the intermediate flows
Expand Down Expand Up @@ -316,6 +313,9 @@ def validate():
iLoss = 0
start = time.time()

# Increment scheduler count
scheduler.step()

# Create checkpoint after every `args.checkpoint_epoch` epochs
if ((epoch % args.checkpoint_epoch) == args.checkpoint_epoch - 1):
dict1 = {
Expand Down