After running train.py, when I run val.py, it reports an error:
File "C:\Users\14547\PycharmProjects\yolov9-main\utils\general.py", line 905, in non_max_suppression
device = prediction.device
^^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'device'
After I change line 903 in general.py from prediction = prediction[0] to prediction = prediction[0][0], val.py gets right.
But when I run train.py again, it reports an error:
File "C:\Users\14547\PycharmProjects\yolov9-main\val.py", line 213, in run
path, shape = Path(paths[si]), shapes[si][0]
IndexError: list index out of range
After I reset line 903 in general.py, train.py gets right.
So need I set line 903 in general.py as `prediction = prediction[0]` when training and set it as `prediction = prediction[0][0]` when testing? Or are there any better solutions?
After running train.py, when I run val.py, it reports an error:
File "C:\Users\14547\PycharmProjects\yolov9-main\utils\general.py", line 905, in non_max_suppression device = prediction.device ^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute 'device'
After I change line 903 in general.py from
prediction = prediction[0]
toprediction = prediction[0][0]
, val.py gets right.But when I run train.py again, it reports an error:
File "C:\Users\14547\PycharmProjects\yolov9-main\val.py", line 213, in run path, shape = Path(paths[si]), shapes[si][0]