yolov9
yolov9 copied to clipboard
Why val/loss was 0?
I am confusused about the result.png.
I have the same problem, has anyone solved it?
I have the same problem, has anyone solved it?
maybe just a bug
I solved it.
I solved it.
thanks
What do you mean by solved it? What did you use for training instead of train_dual.py ? Well, I can indeed see validation results using val_dual.py but still I don't get the results.jpg after training where I can see both train loss and val loss (to evaluate overfitting/underfitting). What's your solution?
What do you mean by solved it? What did you use for training instead of train_dual.py ? Well, I can indeed see validation results using val_dual.py but still I don't get the results.jpg after training where I can see both train loss and val loss (to evaluate overfitting/underfitting). What's your solution?
He means the author said that the val/loss calculations in trian_dual.py are turned off, not really solving the problem.
Thanks
What do you mean by solved it? What did you use for training instead of train_dual.py ? Well, I can indeed see validation results using val_dual.py but still I don't get the results.jpg after training where I can see both train loss and val loss (to evaluate overfitting/underfitting). What's your solution?
I think his intention is to uncomment the code that was commented out in the author's reply; But I directly uncomment computeloss in segment-val_dual.py, it will result in an error. because I just do segment and I don't try change yolov9-val_dual.py Directly, I don't know whether it works.
If you are using train_dual.py you will see that val loss values are always 0. To correct it, you have to change some things in val_dual.py, at line 189. It should be like this:
# Inference
with dt[1]:
preds = model(im) if compute_loss else (model(im, augment=augment), None)
# Loss
if compute_loss:
# preds = preds[1]
# train_out = train_out[1]
loss += compute_loss(preds, targets)[1] # box, obj, cls
else:
preds = preds[0][1]
Keeping train_out commented, the code still gives an error. If you could finish your training with no error with your modification to code, can you share your val_dual.py file in your github by sharing the link?
I commented train_out because you don't need it anymore, since I'm using preds to calculate de loss. With those corrections in val_dual.py you can train with no errors.
I commented train_out because you don't need it anymore, since I'm using preds to calculate de loss. With those corrections in val_dual.py you can train with no errors.
Can you please share your val_dual.py file from your github? I tried your technique but seems it shows some error during training and stops.
I commented train_out because you don't need it anymore, since I'm using preds to calculate de loss. With those corrections in val_dual.py you can train with no errors.
I just did as your corrections but it shows some error during training
in non_max_suppression
device = prediction.device
AttributeError: 'list' object has no attribute 'device'
我成功了!!!你超棒!i success!
我成功了!!你超棒!i success!
How can I modify the code to successfully restore validation losses to normal?
If you are using train_dual.py you will see that val loss values are always 0. To correct it, you have to change some things in val_dual.py, at line 189. It should be like this:
# Inference with dt[1]: preds = model(im) if compute_loss else (model(im, augment=augment), None) # Loss if compute_loss: # preds = preds[1] # train_out = train_out[1] loss += compute_loss(preds, targets)[1] # box, obj, cls else: preds = preds[0][1]
by doing this,you can cope with it well. Just change the val.py's code like the above!And subsequently,you can run the train_dual.py.Ultimately, you can browse the result.csv File, you will find the value from 0 to a positive number. With your continous training,the loss of val will be descent!
I commented train_out because you don't need it anymore, since I'm using preds to calculate de loss. With those corrections in val_dual.py you can train with no errors.
I just did as your corrections but it shows some error during training in non_max_suppression device = prediction.device AttributeError: 'list' object has no attribute 'device'
Have you solved it? I have the same problem.