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

Problem in code #67

Open
titoriya007 opened this issue Dec 23, 2022 · 3 comments
Open

Problem in code #67

titoriya007 opened this issue Dec 23, 2022 · 3 comments

Comments

@titoriya007
Copy link

Please check this error
Traceback (most recent call last):
File "test.py", line 263, in
main()
File "test.py", line 86, in main
main_worker(args.train_gpu, args.ngpus_per_node, args)
File "test.py", line 144, in main_worker
loss_val, mIoU_val, mAcc_val, allAcc_val, class_miou = validate(val_loader, model, criterion)
File "test.py", line 237, in validate
allAcc = sum(intersection_meter.sum) / (sum(target_meter.sum) + 1e-10)
TypeError: 'int' object is not iterable

@tianzhuotao
Copy link
Collaborator

Hi, thanks for being interested in our work.

In my exp, there is no such error reported. Please check your dataset/config preparation.

Thank you.

@MSiam
Copy link

MSiam commented Jan 20, 2023

I am facing the same error actually. It turned out to be because the val_loader was empty it wasn't able to load any images. If you change this line in utils/dataset.py to use Image.open() instead of cv2.imread() when reading the labels it will work. For some reason cv2.imread is returning weird values for the labels probably sth related to the types being read. But Image.open doesn't have this issue.

@wuhu-wang
Copy link

I met the same problem. Have you solved the problem

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

4 participants