Open judycpChen opened 11 months ago
网上说应该将输出图像转成整数,bug是没了,但是结果显示的不对。
I have the same problem, not sure how to solve it. Did you solve it? UPD: as I understood, this error means that program try to save an array to PNG. I found location of this error: file data.py, function saveResult. Object 'img' in this function is ndarray, and I don't know yet how to convert it to PNG file.
UPD2: I still don't know why I get this error because io.imsave must work with numpy arrays. But I found a way to get an images anyway: instead of "io.imsave(os.path.join(save_path,"%d_predict.png"%i),img)" you can write this: Not perfect solution because if you have a lot of test images, it will take a lot of time to save it by yourself. Besides, saved images have axis, like this one:
find and change in saveResult (data.py) for grayscale image
img = labelVisualize(num_class,COLOR_DICT,item) if flag_multi_class else (item[:,:,0]*255).astype(np.uint8)
I ran into this problem when I was running main.py. How do I fix it