Yolo-FastestV2
Yolo-FastestV2 copied to clipboard
IndexError: too many indices for tensor of dimension 1
First of all thanks for your code.
I executed the following code and reported an error.
python3 train.py --data train/mosaic/train.data
Traceback (most recent call last):
File "train.py", line 138, in
I don't know what incurs this error.I hope someone can give me some advice to solve this problem.Thanks a lot.
Problem with dataset format? You can send me the content of your label .txt
Problem with dataset format? You can send me the content of your label .txt
Thanks for your reply
my one of label.txt, The format is the same as darknet, I am sure it can be used in yolo-fastestv1.1, the effect and speed are very good
0 0.501000 0.501493 0.998000 0.997015
my train.data
[name]
model_name=mosaic
[train-configure]
epochs=300
steps=150,250
batch_size=64
subdivisions=1
learning_rate=0.001
[model-configure]
pre_weights=None
classes=3
width=352
height=352
anchor_num=3
anchors=171.69,262.96, 216.69,174.53, 304.65,205.18, 313.94,300.33, 334.99,259.35, 349.61,347.02
[data-configure]
train=/home/zsf/work/Yolo-FastestV2/train/mosaic/train.txt
val=/home/zsf/work/Yolo-FastestV2/train/mosaic/train.txt
names=/home/zsf/work/Yolo-FastestV2/train/mosaic/classes.names
my train.txt, this is part of it and it can be used correctly in yolo-fastestv1.1
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/black/7.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/black/6.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/black/8.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/black/2.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/black/5.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/black/3.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/black/1.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/black/0.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/black/4.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/blue/7.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/blue/6.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/blue/2.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/blue/5.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/blue/3.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/blue/4.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/mosaic/180.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/mosaic/159.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/mosaic/16.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/mosaic/46.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/mosaic/154.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/mosaic/106.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/mosaic/150.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/mosaic/85.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/mosaic/77.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/mosaic/40.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/mosaic/153.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/mosaic/148.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/mosaic/103.jpg
/home/zsf/work/Yolo-FastestV2/train/mosaic/images/mosaic/133.jpg
my classes.names
mosaic
black
blue
my anchors6.txt
171.69,262.96, 216.69,174.53, 304.65,205.18, 313.94,300.33, 334.99,259.35, 349.61,347.02
0.905269
pytorch version?
Problem with dataset format? You can send me the content of your label .txt
I meet the same error.Some label.txt are empty because these labels correspond to negative samples which have no labels.Could you please tell me how to make my dataset with these negative samples?
Fix it in https://github.com/flyskywhy/Yolo-FastestV2/commit/086669648d7826bfcc63d741e5957d5edc4d4ce0