-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Training issue #88
Comments
Thanks, I will check that now |
Hi @longcw now it works, here are the changes leoara01@linuxdev:~/work/yolo2-pytorch$ git diff train.py
diff --git a/train.py b/train.py
index 8c33cb4..51ba809 100644
--- a/train.py
+++ b/train.py
@@ -75,10 +75,10 @@ for step in range(start_epoch * imdb.batch_per_epoch,
# backward
loss = net.loss
- bbox_loss += net.bbox_loss.data.cpu().numpy()[0]
- iou_loss += net.iou_loss.data.cpu().numpy()[0]
- cls_loss += net.cls_loss.data.cpu().numpy()[0]
- train_loss += loss.data.cpu().numpy()[0]
+ bbox_loss += net.bbox_loss.data.cpu().item()
+ iou_loss += net.iou_loss.data.cpu().item()
+ cls_loss += net.cls_loss.data.cpu().item()
+ train_loss += loss.data.cpu().item()
optimizer.zero_grad()
loss.backward()
optimizer.step() Would you like that I create a Pull request for the issue? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I've cloned the code today and try the training and got the following error
I'm using pytorch 0.4
The text was updated successfully, but these errors were encountered: