Skip to content
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

W&B logging error of test.py occurs during training. #254

Open
cslee99 opened this issue Jun 16, 2022 · 0 comments
Open

W&B logging error of test.py occurs during training. #254

cslee99 opened this issue Jun 16, 2022 · 0 comments

Comments

@cslee99
Copy link

cslee99 commented Jun 16, 2022

An error occurs while learning. Please help.
To train with custome data, a data.yaml file was created.
Contents included are as follows.

data.yaml
train: E:/Dev/AI/yolor/data/roboflow/train/images
val: E:/Dev/AI/yolor/data/roboflow/valid/images
test: E:/Dev/AI/yolor/data/roboflow/test/images

nc: 1
names: ['Stone']

Train was driven by the script below.
train Script
python train.py --batch-size 8 --img 416 416 --data data/data.yaml --cfg cfg/yolor_p6.cfg --weights './yolor_p6.pt' --device 0 --name yolor_p6 --names data/data.names --hyp hyp.scratch.1280.yaml --epochs 50

An error occurs at line 164 of test.py.

Traceback (most recent call last):
File "E:\Dev\AI\yolor\train.py", line 537, in
train(hyp, opt, device, tb_writer, wandb)
File "E:\Dev\AI\yolor\train.py", line 336, in train
results, maps, times = test.test(opt.data,
File "E:\Dev\AI\yolor\test.py", line 164, in test
box_data = [{"position": {"minX": xyxy[0], "minY": xyxy[1], "maxX": xyxy[2], "maxY": xyxy[3]},
File "E:\Dev\AI\yolor\test.py", line 166, in
"box_caption": "%s %.3f" % (names[cls], conf),
TypeError: list indices must be integers or slices, not float

The value of the cls variable is displayed as a float. (0.0, 23.0)
Shouldn't it be changed in the code above?
change code : name[cls] ==> name[int(cls)]

Also, I have nc:1 and num of classes is 1, so why does it come out with values of 23.0 and 31.0?

First, to see that it works perfectly, I changed the code to names[0] and proceeded.
However, at line 170 of test.py, the following error occurs.

wandb_images 'list' object has no attribute 'items'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant