Skip to content

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanSeriesX committed Oct 29, 2023
1 parent b43841b commit c03370a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions u2net_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ def muti_bce_loss_fusion(d_list, labels_v):


def train_model(net, optimizer, dataloader, device, epoch_num, save_frq):
print("---\n")
iteration_count = load_checkpoint(net, optimizer)
cumulative_loss = 0.0
epoch_loss = 0.0
print("---\n")

for epoch in range(int(iteration_count / len(dataloader)), epoch_num):
net.train()
Expand Down Expand Up @@ -144,7 +144,6 @@ def train_model(net, optimizer, dataloader, device, epoch_num, save_frq):
save_model_as_onnx(
net, device, iteration_count
) # in ONNX format! ^_^ UwU
print("Model saved")

if iteration_count % len(dataloader) == 0:
if epoch + 1 < epoch_num:
Expand Down

0 comments on commit c03370a

Please sign in to comment.